Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caused by android.view.InflateException Binary XML file line #101: Caused by android.content.res.Resources$NotFoundException

Tags:

android

bundle

Got this error from Crashlytics, affecting a few devices:

Caused by android.view.InflateException Binary XML file line #101: Binary XML file line #101: Error inflating class

Caused by android.content.res.Resources$NotFoundException Drawable (missing name) with resource ID #0x7f06008a

The interesting thing is that this has only come about since I released the app in the new Android App Bundle. This didn't happen when releasing the .apk. In fact to resolve it I reverted back to release it as .apk. But I want to have the benefits of a release with the new Android App Bundle. I know it's something to do with the Drawable folders. Here's line 101 in the xml file:

<ImageView
    android:id="@+id/learn_chords_help_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="0dp"
    android:paddingTop="20dp"
    android:src="@drawable/help"
    android:contentDescription="Learn Chords Help"
    android:layout_toRightOf="@id/learn_chords_button"
    android:layout_above="@id/creditText"
    />

Here's all my drawable folders with/without help.png:

drawable -> help.png
drawable-hdpi -> help.png
drawable-nodpi -> No Help image
drawable-xhdpi -> No Help image
drawable-xxhdpi -> help.png

Here's some devices that the error occurred on (according to Crashlytics, I couldn't replicate it with the few test handsets we have): Galaxy J7(2016) 7.0, Optimus L40 4.42, m3 Note 5.1, Galaxy s4 4.4.2)

Is this a bug in the Google Play's new App Bundle format, or do developers need to have all the drawable folders with assets in each of them?

like image 442
TomV Avatar asked Oct 25 '18 13:10

TomV


1 Answers

Since you don't have help.png in xhdpi folder, that's why you have that error, because xhdpi is associated for 720 X 1280px density (ex: Galaxy J7).

You could put only the xxhdpi picture to no-dpi folder, or put that picture in all the folders.

like image 190
Florescu Cătălin Avatar answered Oct 18 '22 01:10

Florescu Cătălin