Fire base错误android

时间:2016-08-15 10:52:32

标签: java android firebase

我收到此错误

 java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: android.content.res.Resources$NotFoundException: String resource ID #0x7f070040
     at android.app.ActivityThread.installProvider(ActivityThread.java:5454)
     at android.app.ActivityThread.installContentProviders(ActivityThread.java:5046)
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4986)
     at android.app.ActivityThread.access$1600(ActivityThread.java:177)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1495)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:135)
     at android.app.ActivityThread.main(ActivityThread.java:5930)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
 Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f070040
     at android.content.res.Resources.getText(Resources.java:553)
     at android.content.res.Resources.getString(Resources.java:639)
     at com.google.android.gms.common.internal.zzah.getString(Unknown Source)
     at com.google.firebase.FirebaseOptions.fromResource(Unknown Source)
     at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
     at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
     at android.content.ContentProvider.attachInfo(ContentProvider.java:1737)
     at android.content.ContentProvider.attachInfo(ContentProvider.java:1712)
     at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
     at android.app.ActivityThread.installProvider(ActivityThread.java:5451)
     at android.app.ActivityThread.installContentProviders(ActivityThread.java:5046) 
     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4986) 
     at android.app.ActivityThread.access$1600(ActivityThread.java:177) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1495) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:135) 
     at android.app.ActivityThread.main(ActivityThread.java:5930) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:372) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200) 

我在gradle中的应用程序ID,正如通过回答另一个问题所建议的那样 并且只使用一行firebase(它不进入主要活动的oncreate方法BTW) 如果可能的话,请告诉我可能出现此错误的原因,如果您无法找到问题的确切原因 提前谢谢

firebaseAnalytics = FirebaseAnalytics.getInstance(this);

0 个答案:

没有答案