android – NoClassDefFoundError:com.google.firebase.FirebaseOptions

前端之家收集整理的这篇文章主要介绍了android – NoClassDefFoundError:com.google.firebase.FirebaseOptions前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我继续得到我正在使用的其他测试设备(4.4.2)上的NoClassDefFoundError.但在我的测试设备( Android 5.1)上工作正常.

我尝试了我已经搜索解决方案,没有什么似乎有效.

我正在使用Firebase实时数据库.有人可以帮忙吗?

这是错误日志:

06-03 01:36:29.607 2655-2655/mobapps.mypersonal.biz.grouptracker E/dalvikvm: Could not find class 'com.google.firebase.FirebaSEOptions',referenced from method com.google.firebase.FirebaseApp.<init> 06-03 01:36:29.617 2655-2655/mobapps.mypersonal.biz.grouptracker E/dalvikvm: Could not find class 'com.google.firebase.FirebaseApp$zzb',referenced from method com.google.firebase.FirebaseApp.zzaJ 06-03 01:36:29.621 2655-2655/mobapps.mypersonal.biz.grouptracker E/dalvikvm: Could not find class 'com.google.firebase.FirebaseApiNotAvailableException',referenced from method com.google.firebase.FirebaseApp.getToken 06-03 01:36:29.629 2655-2655/mobapps.mypersonal.biz.grouptracker E/dalvikvm: Could not find class 'com.google.firebase.FirebaseApp$zza',referenced from method com.google.firebase.FirebaseApp.zza 06-03 01:36:29.639 2655-2655/mobapps.mypersonal.biz.grouptracker E/AndroidRuntime: FATAL EXCEPTION: main
    Process: mobapps.mypersonal.biz.grouptracker,PID: 2655
    java.lang.NoClassDefFoundError: com.google.firebase.FirebaSEOptions
        at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1656)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1627)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
        at android.app.ActivityThread.installProvider(ActivityThread.java:5079)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4653)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4593)
        at android.app.ActivityThread.access$1500(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:5363)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
        at dalvik.system.NativeStart.main(Native Method)

解决方法

这是什么解决了我的问题:

>将编译’com.android.support:multidex:1.0.1’添加
应用程序/的build.gradle.
>将android:name =“android.support.multidex.MultiDexApplication”添加到AndroidManifest.xml中的应用程序标签.

如果您使用自定义应用程序类,请跳过AndroidManifest.xml,并使您的Application类扩展MultiDexApplication而不是应用程序.

原文链接:https://www.f2er.com/android/311472.html

猜你在找的Android相关文章