Google登录在启动时使Flutter应用程序崩溃

时间:2019-08-23 04:49:21

标签: flutter dart firebase-authentication google-authentication

我有一个Flutter应用程序,该应用程序使用Firebase身份验证和Google登录。在准备将其用于初始测试版本以在调试模式之外尝试之前,该应用程序运行良好。从那以后,当尝试在Android Studio中调试运行时,该应用程序在启动时立即崩溃。

Flutter医生显示了此信息

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.13.6 17G66, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.5)
[✓] Connected device (1 available)

• No issues found!

我已经找到了一些答案,可以尝试从Google Play控制台和firebase对齐SHA键以及更改程序包版本,但是我没有找到任何有效的组合。

“运行”控制台仅显示:

Launching lib/main.dart on Pixel in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Built build/app/outputs/apk/debug/app-debug.apk.

我也在日志中得到了这个

2019-08-22 21:44:28.640 16297-16297/com.test.perklapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.test.perklapp, PID: 16297
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/auth/internal/InternalAuthProvider;
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:453)
        at java.lang.Class.forName(Class.java:378)
        at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.1.0:78)
        at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.1.0:71)
        at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.1.0:411)
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:306)
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:273)
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:257)
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.1.0:53)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1920)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1895)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.1.0:47)
        at android.app.ActivityThread.installProvider(ActivityThread.java:6440)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5987)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5902)
        at android.app.ActivityThread.access$1100(ActivityThread.java:200)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: java.lang.ClassNotFoundException: com.google.firebase.auth.internal.InternalAuthProvider
        at java.lang.VMClassLoader.findLoadedClass(Native Method)
        at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:453) 
        at java.lang.Class.forName(Class.java:378) 
        at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.1.0:78) 
        at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.1.0:71) 
        at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.1.0:411) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:306) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:273) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:257) 
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.1.0:53) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1920) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1895) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.1.0:47) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:6440) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5987) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5902) 
        at android.app.ActivityThread.access$1100(ActivityThread.java:200) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6718) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/internal/InternalTokenProvider;
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:453) 
        at java.lang.Class.forName(Class.java:378) 
        at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.1.0:78) 
        at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.1.0:71) 
        at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.1.0:411) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:306) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:273) 
        at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:257) 
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.1.0:53) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1920) 
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1895) 
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.1.0:47) 
        at android.app.ActivityThread.installProvider(ActivityThread.java:6440) 
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5987) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5902) 
        at android.app.ActivityThread.access$1100(ActivityThread.java:200) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6718) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.internal.InternalTokenProvider" on path: DexPathList[[zip file "/data/app/com.test.perklapp-8iwPo_650CpCeJcSMtZqoQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.test.perklapp-8iwPo_650CpCeJcSMtZqoQ==/lib/arm64, /data/app/com.test.perklapp-8iwPo_650CpCeJcSMtZqoQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

还有其他人遇到过这样的事情吗?我一直在努力找回我的应用程序,因为它之前运行良好,但到目前为止没有任何效果。希望有帮助!

0 个答案:

没有答案