我在我的 Flutter 应用程序上添加了一些依赖项,但在构建应用程序时出现错误。该应用程序已运行。拜托,谁能告诉我正确的原因?
依赖关系,
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.7.0
firebase_auth: ^0.20.0
firebase_database: ^6.0.0
#cloud_firestore: ^0.16.0
firebase_storage: ^7.0.0
flutter_staggered_grid_view: ^0.4.0
fluttertoast: ^8.0.6
google_maps_place_picker: ^1.0.1
image_picker: ^0.6.7+22
multi_image_picker: ^4.7.14
transparent_image: ^2.0.0
警告,
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Note: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.7.0\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.20.1\android\src\main\java\io\flutter\plugins\firebase\auth\FlutterFirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_storage-7.0.0\android\src\main\java\io\flutter\plugins\firebase\storage\FlutterFirebaseStoragePlugin.java:38: warning: [deprecation] Registrar in PluginRegistry has been deprecated
public static void registerWith(PluginRegistry.Registrar registrar) {
^
1 warning
答案 0 :(得分:1)
如果您有 application.java 替换为以下内容:
@Override
public void registerWith(PluginRegistry registry) {
FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
}