添加 flutter_firebase_ui 后 flutter 应用程序崩溃

flutter app crashing after adding flutter_firebase_ui

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

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的版本 看到这个link:URL

你应该使用 firebase_auth: 0.7.0

通过在 AndroidManifest.xml 中添加 Facebook 应用程序 ID 解决了问题
尝试使用 Android studio 运行 Android 应用程序,您将收到错误消息

 <meta-data android:name="com.facebook.sdk.ApplicationId"
            android:value="adasdsa"/>