在flutter的android应用崩溃中添加了一些Firebase库后,

时间:2019-05-08 07:12:08

标签: android firebase flutter flutter-dependencies

在flutter的android应用崩溃中添加了一些Firebase库后

 minSdkVersion 21
        targetSdkVersion 28


 dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
    }


 cloud_firestore: ^0.8.2  
  firebase_core: ^0.2.5
  firebase_messaging: ^5.0.1
  

2019-05-08 12:41:40.484 16013-16013 /? E / AndroidRuntime:致命   例外:主要       流程:myapp.com.myapp,PID:16013       java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / firebase / internal / InternalTokenProvider;           在java.lang.Class.classForName(本机方法)           在java.lang.Class.forName(Class.java:453)           在java.lang.Class.forName(Class.java:378)           com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common @@ 17.0.0:78)           com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common @@ 17.0.0:71)           com.google.firebase.FirebaseApp。(com.google.firebase:firebase-common @@ 17.0.0:468)           com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common @@ 17.0.0:354)           在com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common @@ 17.0.0:321)           在com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common @@ 17.0.0:305)           在com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common @@ 17.0.0:53)           在android.content.ContentProvider.attachInfo(ContentProvider.java:1919)           在android.content.ContentProvider.attachInfo(ContentProvider.java:1894)           com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common @@ 17.0.0:47)           在android.app.ActivityThread.installProvider(ActivityThread.java:6263)           在android.app.ActivityThread.installContentProviders(ActivityThread.java:5829)           在android.app.ActivityThread.handleBindApplication(ActivityThread.java:5737)           在android.app.ActivityThread.-wrap1(未知来源:0)           在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1659)           在android.os.Handler.dispatchMessage(Handler.java:106)           在android.os.Looper.loop(Looper.java:164)           在android.app.ActivityThread.main(ActivityThread.java:6518)           在java.lang.reflect.Method.invoke(本机方法)           在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:438)           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)   2019-05-08 12:41:40.488 16013-16013 /? E / AndroidRuntime:由以下原因引起:   java.lang.ClassNotFoundException:找不到类   路径上的“ com.google.firebase.internal.InternalTokenProvider”   DexPathList [[zip文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/base.apk”,邮政编码   文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_dependencies_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_resources_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_0_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_1_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_2_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_3_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_4_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_5_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_6_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_7_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_8_apk.apk”,   压缩文件   “ /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw/w2wCXQ=   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/base.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_dependencies_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_resources_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_0_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_1_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_2_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_3_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_4_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_5_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_6_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_7_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_8_apk.apk!/lib/armeabi-v7a,   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_9_apk.apk!/lib/armeabi-v7a,   / system / lib,/ vendor / lib]]           在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)           在java.lang.ClassLoader.loadClass(ClassLoader.java:379)           在java.lang.ClassLoader.loadClass(ClassLoader.java:312)             ...另外24个         禁止:java.io.IOException:找不到用于dex位置的原始dex文件   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_resources_apk.apk           在dalvik.system.DexFile.openDexFileNative(本机方法)           在dalvik.system.DexFile.openDexFile(DexFile.java:353)           在dalvik.system.DexFile。(DexFile.java:100)           在dalvik.system.DexFile。(DexFile.java:74)           在dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)           在dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)           在dalvik.system.DexPathList。(DexPathList.java:157)           在dalvik.system.BaseDexClassLoader。(BaseDexClassLoader.java:65)           在dalvik.system.PathClassLoader。(PathClassLoader.java:64)           在com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)           在com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)   2019-05-08 12:41:40.491 16013-16013 /? E / AndroidRuntime:位于   android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)           在android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:35)           在android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:693)           在android.app.LoadedApk.getClassLoader(LoadedApk.java:727)           在android.app.LoadedApk.getResources(LoadedApk.java:954)           在android.app.ContextImpl.createAppContext(ContextImpl.java:2270)           在android.app.ActivityThread.handleBindApplication(ActivityThread.java:5654)                 ...另外8个         禁止:java.io.IOException:找不到用于dex位置的原始dex文件   /data/app/myapp.com.myapp-EPX9OHQHpG7_cpLXw2wCXQ==/split_lib_slice_7_apk.apk           在dalvik.system.DexFile.openDexFileNative(本机方法)           在dalvik.system.DexFile.openDexFile(DexFile.java:353)           在dalvik.system.DexFile。(DexFile.java:100)           在dalvik.system.DexFile。(DexFile.java:74)           在dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)           在dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)           在dalvik.system.DexPathList。(DexPathList.java:157)           在dalvik.system.BaseDexClassLoader。(BaseDexClassLoader.java:65)           在dalvik.system.PathClassLoader。(PathClassLoader.java:64)           在com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)           在com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)           在android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)           在android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:35)           在android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:693)           在android.app.LoadedApk.getClassLoader(LoadedApk.java:727)           在android.app.LoadedApk.getResources(LoadedApk.java:954)           在android.app.ContextImpl.createAppContext(ContextImpl.java:2270)           在android.app.ActivityThread.handleBindApplication(ActivityThread.java:5654)                 ...另外8个

1 个答案:

答案 0 :(得分:0)

更改此:

firebase_core: ^0.2.5

到以下:

firebase_core: ^0.4.0

在此处查看最新更改:

https://pub.dev/packages/firebase_core#-changelog-tab-