添加 flutter_firebase_ui 后 flutter 应用程序崩溃

标签 flutter firebase-authentication flutter-dependencies

当我添加这两个库时,我的应用程序无法运行,它仅显示关闭应用程序对话框

image_picker: 0.4.12+1 #^0.5.0+3
flutter_firebase_ui: ^0.0.13

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) Built build/app/outputs/apk/debug/app-debug.apk. Flutter is taking longer than expected to report its views. Still trying...

删除 flutter_firebase_ui: ^0.0.13 后,我的应用程序运行正常
但在我的其他项目中我使用flutter_firebase_ui: ^0.0.13 没有
image_picker: 0.4.12+1 #^0.5.0+3 并且工作正常。
问题是什么?

Note: /home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /home/midhilaj/.pub-cache/git/flutter_twitter_login-b28bcb56f7f86319a966dcf3a08543de358b1424/android/src/main/java/com/roughike/fluttertwitterlogin/fluttertwitterlogin/TwitterLoginPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

当我删除 flutter_firebase_ui 时:^0.0.13 应用程序工作没有任何问题

 Launching lib/main.dart on Lenovo K8 Plus in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:9: error: cannot find symbol
import androidx.annotation.NonNull;
                          ^
  symbol:   class NonNull
  location: package androidx.annotation
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:10: error: cannot find symbol
import androidx.annotation.Nullable;
                          ^
  symbol:   class Nullable
  location: package androidx.annotation
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:706: error: cannot find symbol
  private void reportException(Result result, @Nullable Exception exception) {
                                               ^
  symbol:   class Nullable
  location: class FirebaseAuthPlugin
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:610: error: cannot find symbol
    public void onComplete(@NonNull Task<AuthResult> task) {
                            ^
  symbol:   class NonNull
  location: class FirebaseAuthPlugin.SignInCompleteListener
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:629: error: cannot find symbol
    public void onComplete(@NonNull Task<Void> task) {
                            ^
  symbol:   class NonNull
  location: class FirebaseAuthPlugin.TaskVoidCompleteListener
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:647: error: cannot find symbol
    public void onComplete(@NonNull Task<SignInMethodQueryResult> task) {
                            ^
  symbol:   class NonNull
  location: class FirebaseAuthPlugin.GetSignInMethodsCompleteListener
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:187: error: cannot find symbol
                      public void onComplete(@NonNull Task<AuthResult> task) {
                                              ^
  symbol: class NonNull
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:492: error: cannot find symbol
              public void onComplete(@NonNull Task<GetTokenResult> task) {
                                      ^
  symbol: class NonNull
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:559: error: cannot find symbol
          public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
                                          ^
  symbol: class NonNull
9 errors
         *********************************************************
WARNING: This version of firebase_auth will break your Android build if it or its dependencies aren't compatible with AndroidX.
         See "shorturl" for more information on the problem and how to fix it.
         This warning prints for all Android build failures. The real root cause of the error may be unrelated.
         *********************************************************

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':firebase_auth:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

最佳答案

您需要选择与androidX兼容的版本 请参阅此链接:URL

您应该使用 firebase_auth: 0.7.0

关于添加 flutter_firebase_ui 后 flutter 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55044329/

相关文章:

javascript - Firebase 用户删除不起作用

javascript - 如何从url中获取参数?

flutter - map <对象? Object> 不是类型 'Map<String,dynamic> 的子类型

firebase - #flutter:配置 ':cloud_firestore_web'时出现问题

flutter - 如何在隔离中加载和解析Json?

firebase - Firebase 存储安全规则中有哪些不同类型的匹配?

android - Flutter 中的 rxdart 用法未被识别

flutter - 在 Dart 中执行可选(可为空) `Function`

dart - 如何将图像适合作为容器小部件的背景图像?

flutter - 如何在 flutter 中使用可注入(inject)和 get_it 的共享偏好?