应用程序捆绑引起致命异常:android.content.res.Resources $ NotFoundException

时间:2018-10-06 16:39:34

标签: android gradle android-app-bundle

我从APK切换到应用包,并且从crashlitics中收到以下错误:

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f0800b5
       at android.content.res.Resources.getValue(Resources.java:1561)
       at android.content.res.MiuiResources.getValue(MiuiResources.java:146)
       at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:332)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
       at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
       at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
       at android.support.v7.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:425)
       at android.support.v7.view.menu.ActionMenuItemView.initialize(ActionMenuItemView.java:129)
       at android.support.v7.widget.ActionMenuPresenter.bindItemView(ActionMenuPresenter.java:211)
       at android.support.v7.view.menu.BaseMenuPresenter.getItemView(BaseMenuPresenter.java:186)
       at android.support.v7.widget.ActionMenuPresenter.getItemView(ActionMenuPresenter.java:197)
       at android.support.v7.widget.ActionMenuPresenter.flagActionItems(ActionMenuPresenter.java:479)
       at android.support.v7.view.menu.MenuBuilder.flagActionItems(MenuBuilder.java:1160)
       at android.support.v7.view.menu.BaseMenuPresenter.updateMenuView(BaseMenuPresenter.java:95)
       at android.support.v7.widget.ActionMenuPresenter.updateMenuView(ActionMenuPresenter.java:234)
       at android.support.v7.view.menu.MenuBuilder.dispatchPresenterUpdate(MenuBuilder.java:292)
       at android.support.v7.view.menu.MenuBuilder.onItemsChanged(MenuBuilder.java:1047)
       at android.support.v7.view.menu.MenuBuilder.startDispatchingItemsChanged(MenuBuilder.java:1074)
       at android.support.v7.app.AppCompatDelegateImplV9.preparePanel(AppCompatDelegateImplV9.java:1410)
       at android.support.v7.app.AppCompatDelegateImplV9.doInvalidatePanelMenu(AppCompatDelegateImplV9.java:1648)
       at android.support.v7.app.AppCompatDelegateImplV9$1.run(AppCompatDelegateImplV9.java:140)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loop(Looper.java:207)
       at android.app.ActivityThread.main(ActivityThread.java:5856)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)

在我的R.java中:

public static int design_fab_size_mini = 0x7f0800b5;

关于发生了什么以及如何解决的任何想法?

1 个答案:

答案 0 :(得分:2)

是的,将apk侧载到其他设备后,这会在Android App Bundle中发生,这是正常现象,请参阅文档 https://developer.android.com/guide/app-bundle/

  

因为安装应用可能需要下载多个APK(例如   基本APK及其一些配置APK),您应该   手动将应用的APK转移到设备上时也要小心(也   称为侧载)。否则,您的应用可能会遇到运行时问题   由于缺少代码和资源而导致的问题。