looking at Crashlytics reports for my app I often see crashes related to resources not found. I put all drawables in density-specific folders, as well as the "drawable" folder, but I'm still getting some of these crashes. For example, I have an image called "header" which I put in the following folders: "drawable", "drawable-mdpi", "drawable-hdpi", "drawable-xhdpi" and "drawable-xxhdpi". I can see the app crashed on a Nexus 5X with Android 8.1.0. This phone's screen has a density of 423ppi, so it should look for images in xhdpi folder, right? So why is it unable to find the resource? Thanks to anyone who can help me understand what I'm doing wrong.
2 Answers
If your resource is at least within the drawable folder it will find it. Other folders will help you render a better suitable-sized resource for your users.
First, go through your logs that are attached with your crash stack trace to better identify where in your user's journey this crash occurs.
I wouldn't be surprised that at some point in your code, you're initializing your drawable with a default Integer value at 0 or maybe fallback to such values. Since a drawable res is an integer, it will compile just fine. But trying to load a resource with the value 0 will crash with this exception.
Hope it helps pinpoint your issue!

- 1,815
- 1
- 17
- 28
I have a similar issue and it also only happened on Nexus 5X running 8.1.0. THere is a similar thread here: Android Resources$NotFoundException: Unable to find resource ID

- 187
- 1
- 6