NoClassDefFoundError:com.google.firebase.FirebaseOptions(firebase and admob)

时间:2016-12-22 10:19:00

标签: android firebase admob

我感到很困扰,因为:

  

java.lang.NoClassDefFoundError:com.google.firebase.FirebaseOptions                                                                              在com.google.firebase.FirebaseApp.initializeApp(未知来源)                                                                              在com.google.firebase.provider.FirebaseInitProvider.onCreate(未知来源)                                                                              在android.content.ContentProvider.attachInfo(ContentProvider.java:1214)                                                                              在android.content.ContentProvider.attachInfo(ContentProvider.java:1189)                                                                              在com.google.firebase.provider.FirebaseInitProvider.attachInfo(未知来源)                                                                              在android.app.ActivityThread.installProvider(ActivityThread.java:4912)                                                                              在android.app.ActivityThread.installContentProviders(ActivityThread.java:4518)                                                                              在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4458)                                                                              在android.app.ActivityThread.access $ 1300(ActivityThread.java:144)                                                                              在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1319)                                                                              在android.os.Handler.dispatchMessage(Handler.java:99)                                                                              在android.os.Looper.loop(Looper.java:137)                                                                              在android.app.ActivityThread.main(ActivityThread.java:5136)                                                                              at java.lang.reflect.Method.invokeNative(Native Method)                                                                              在java.lang.reflect.Method.invoke(Method.java:525)                                                                              在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:737)                                                                              在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)                                                                              在dalvik.system.NativeStart.main(本地方法)

1 个答案:

答案 0 :(得分:1)

当您在项目中使用Google Play服务相关性时,通常会发生这种情况。

只需将Google Play服务依赖关系降级为compile 'com.google.android.gms:play-services:8.3.0',问题就可能得到解决。