Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f08012e
at android.content.res.ResourcesImpl.getResourceName(ResourcesImpl.java:253)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:760)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:630)
at android.content.res.Resources.loadDrawable(Resources.java:886)
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
at android.content.res.TypedArray.getDrawable(TypedArray.java:928)
我从 Firebase 中得到了这些错误日志,仅在 Nexus 5X Oreo 8.1 上发生。同时,ImageView 搜索的资源已经在以下这些 drawable 文件夹中可用:
- drawable-hdpi
- drawable-mdpi
- drawable-xhdpi
- drawable-xxhdpi
- drawable-xxxhdpi
它只是一个小的 png 图标,所以大小不是问题。该项目的最小支持 SDK 版本为 API 级别 21,并且我已经尝试在模拟器中运行它,但崩溃并未发生。
所以,我需要一个适当的修复方法和重新生成的方式... 只是为了检查是否已解决问题。
谢谢!
drawable-v24
而不是drawable hdpi,xhdpi
中。有时会因资源而出现错误。 - M DEV