Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resources$NotFoundException: Drawable (missing name) with resource ID

    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)

I got this as error logs from firebase. It's only happening on Nexus 5X Oreo 8.1 Also the resource for which xml ImageView is searching for is already available in these drawable folders:

  • drawable-hdpi
  • drawable-mdpi
  • drawable-xhdpi
  • drawable-xxhdpi
  • drawable-xxxhdpi

Its just a small png icon, so size isn't the issue. The project's min supported sdk is API Level 21 and I have already tried running it in an emulator but crash didn't occur.

So, I need a proper fix and way of regenerating this if possible...just to check if it's fixed or not.

Thank you!

like image 886
Ishu Sharma Avatar asked Dec 08 '25 05:12

Ishu Sharma


1 Answers

This issue has been elaborated throughly by Crispert here.

The problem:

If you're using App Bundle (.aab) file, this issue is (probably) related to Google's stripping suitable drawables to specific users phones. While they try to cover all screen densities, some devices are falling between the chairs and thus, not getting any resource (aren't xhdp, xxhdp, xxxhdpi and etc). The device you mention is probably one of them.

The solution:

As annoying as it seems, put the resource in the "drawable" directory, as @Yuriy suggested, to indicate Google that this resource should be copied to all .apks

like image 129
Oz Shabat Avatar answered Dec 10 '25 17:12

Oz Shabat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!