Android Fabric Crashlytics在应用启动时因资源$ NotFoundException而崩溃

时间:2018-03-29 09:28:05

标签: crashlytics crashlytics-android

android.content.res.Resources$NotFoundException
android.content.res.ResourcesImpl.getResourcePackageName

将Crashlytics从 2.6.6升级到2.9.1 后,我们开始注意到Google Play控制台崩溃。

此崩溃发生在Crashlytics初始化之前,因此从未在Crashlytics中报告:

java.lang.RuntimeException: 
  at android.app.ActivityThread.installProvider (ActivityThread.java:6423)
  at android.app.ActivityThread.installContentProviders (ActivityThread.java:6012)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5951)
  at android.app.ActivityThread.-wrap3 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1710)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6776)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1518)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408)

Caused by: android.content.res.Resources$NotFoundException: 
  at android.content.res.ResourcesImpl.getResourcePackageName (ResourcesImpl.java:248)
  at android.content.res.Resources.getResourcePackageName (Resources.java:2785)
  at io.fabric.sdk.android.services.common.CommonUtils.getResourcePackageName (CommonUtils.java:767)
  at io.fabric.sdk.android.services.common.CommonUtils.getResourcesIdentifier (CommonUtils.java:517)
  at io.fabric.sdk.android.services.common.CommonUtils.getBooleanResourceValue (CommonUtils.java:498)
  at io.fabric.sdk.android.services.common.FirebaseInfo.isFirebaseCrashlyticsEnabled (FirebaseInfo.java:52)
  at com.crashlytics.android.CrashlyticsInitProvider.shouldInitializeFabric (CrashlyticsInitProvider.java:73)
  at com.crashlytics.android.CrashlyticsInitProvider.onCreate (CrashlyticsInitProvider.java:25)
  at android.content.ContentProvider.attachInfo (ContentProvider.java:1759)
  at android.content.ContentProvider.attachInfo (ContentProvider.java:1734)
  at android.app.ActivityThread.installProvider (ActivityThread.java:6420)
  at android.app.ActivityThread.installContentProviders (ActivityThread.java:6012)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5951)
  at android.app.ActivityThread.-wrap3 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1710)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6776)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1518)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408)

崩溃不会影响太多用户,但他们无法启动应用程序。 即我们有这个比例:

  • 受影响的用户:93
  • 报告总数:4,221

1 个答案:

答案 0 :(得分:0)

这件事也在我身上发生。我无法重现它,但是在分析了Crashlytics日志历史记录后,我意识到在移至应用程序捆绑包之后它开始发生。 所以我回到了APK ,现在不再遇到这些问题了。

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.xxx/com.xxx.xx.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f0700e7
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2733)
       at android.app.ActivityThread.-wrap12(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1480)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6146)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

enter image description here