Android HDPI resource not found, but there

in our application with over half a million downloads that I see from Google Play, it reports the following stack trace:

Caused by: android.content.res.Resources$NotFoundException: File res/drawable/trans_button_bg.xml from drawable resource ID #0x7f02020b
at android.content.res.Resources.loadDrawable(Resources.java:1961)
at android.content.res.TypedArray.getDrawable(TypedArray.java:653)
at android.view.View.<init>(View.java:1961)
at android.widget.TextView.<init>(TextView.java:458)
at android.widget.Button.<init>(Button.java:108)
at android.widget.Button.<init>(Button.java:104)
... 38 more
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/transdark_active.9.png from drawable resource ID #0x7f02020c
at android.content.res.Resources.loadDrawable(Resources.java:2008)
at android.content.res.Resources.getDrawable(Resources.java:601)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:162)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:787)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:728)
at android.content.res.Resources.loadDrawable(Resources.java:1936)
... 43 more
Caused by: java.io.FileNotFoundException: res/drawable-hdpi/transdark_active.9.png
at android.content.res.AssetManager.openNonAssetNative(Native Method)
at android.content.res.AssetManager.openNonAsset(AssetManager.java:409)
at android.content.res.Resources.loadDrawable(Resources.java:1970)
... 48 more

for me, it seems he tried to load drawable/trans_button_bg.xml, which is a simple selector:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/transdark_active" /> <!-- pressed -->
<item android:state_focused="true" 
android:drawable="@drawable/transdark_active" /> <!-- focused -->
<item android:drawable="@drawable/trans_button" /> <!-- default -->
</selector>

which calls 9 patch transdark_active.9.png, which is available for mdpi, hdpi and xhdpi:

enter image description here

this is just an example, stack, since I have other similar stacks for other assets that are not loading.

Device corruption for this error report:

  • Galaxy S4 (jflte) 66.7%
  • Galaxy S2 (GT-I9100) 13.3%
  • Galaxy Note II (t03g) 6.7%
  • Galaxy S2 Plus (s2vep) 6.7%
  • Desire HD (Ace)

so my question is:

Is this Samsung as usual, or am I missing something in the code?

+3

All Articles