Fenix: FNX2-16472 ⁃ [Bug] NotFoundException: File res/drawable/ic_readermode_selected.xml from drawable resource ID #0x7f08019d

Created on 9 Jun 2020  ·  5Comments  ·  Source: mozilla-mobile/fenix

Steps to reproduce

  1. Cold startup the browser
  2. Open https://example.com

Expected behavior

Website is opened

Actual behavior

App crashes with the following stack trace:

74e4eb26-33d7-4803-bcd6-4e8738c5090b
android.content.res.Resources$NotFoundException: File res/drawable/ic_readermode_selected.xml from drawable resource ID #0x7f08019d

* Sentry: https://sentry.prod.mozaws.net/operations/fenix-fennec-nightly/?query=d2189fb3af5342249777fc913b331fc3

android.content.res.Resources$NotFoundException: File res/drawable/ic_readermode_selected.xml from drawable resource ID #0x7f08019d
    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2652)
    at android.content.res.Resources.loadDrawable(Resources.java:2552)
    at android.content.res.Resources.getDrawable(Resources.java:813)
    at android.content.Context.getDrawable(Context.java:458)
    at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:2)
    at org.mozilla.fenix.browser.BrowserFragment.initializeUI(BrowserFragment.kt:6)
    at org.mozilla.fenix.browser.BaseBrowserFragment.onViewCreated(BaseBrowserFragment.kt:1)
    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:21)
    at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:25)
    at androidx.fragment.app.FragmentManager.addAddedFragments(FragmentManager.java:5)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:53)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:11)
    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:4)
    at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:1)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:234)
    at android.app.ActivityThread.main(ActivityThread.java:5526)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/$ic_readermode_selected__0.xml from color state list resource ID #0x7f080090
    at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2763)
    at android.content.res.Resources.loadColorStateList(Resources.java:2712)
    at android.content.res.TypedArray.getColor(TypedArray.java:439)
    at android.graphics.drawable.VectorDrawable$VFullPath.updateStateFromTypedArray(VectorDrawable.java:1605)
    at android.graphics.drawable.VectorDrawable$VFullPath.inflate(VectorDrawable.java:1584)
    at android.graphics.drawable.VectorDrawable.inflateInternal(VectorDrawable.java:666)
    at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:571)
    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1215)
    at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1124)
    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2642)
    ... 20 more
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #14: invalid color state list tag gradient
    at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:217)
    at android.content.res.ColorStateList.createFromXml(ColorStateList.java:201)
    at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2759)
    ... 29 more

Device information

  • Android device: Sony Xperia Z2, Android 6.0.1
  • Fenix version:
    Nightly 200609 06:00 (Build #2015745201)
    45.0.20200608190110, 8ec16f840
    GV: 79.0a1-20200608094842
    AS: 60.0.0
ReaderMode S1 crash engverified triage 🐞 bug

All 5 comments

Commit e9189dc089ac6dd15aad0663698e03363584eb22 might be the cause for this crash since it introduces the new file ic_readermode_selected.xml that is mentioned in the strack trace.

Searching for the _invalid color state list tag gradient_ error message yielded that https://developer.android.com/reference/android/graphics/drawable/VectorDrawable only supports gradients for SDK 24+, so this will likely not crash on Android 7.0 or higher, see #10482 #4485

Hi, reproducible on OnePlus A3 (Android 6.0.1) when trying to navigate to theverge.com

► Video
20200609-114101

► Crash stack trace:
8dbafafb-40eb-4851-8d31-998b20a6b6ff
android.content.res.Resources$NotFoundException: File res/drawable/ic_readermode_selected.xml from drawable resource ID #0x7f08019d

* Sentry: https://sentry.prod.mozaws.net/operations/fenix-nightly/?query=00ab1f5f18fb4f1baa8dd85b059eab2e

android.content.res.Resources$NotFoundException: File res/drawable/ic_readermode_selected.xml from drawable resource ID #0x7f08019d
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2654)
at android.content.res.Resources.loadDrawable(Resources.java:2554)
at android.content.res.Resources.getDrawable(Resources.java:820)
at android.content.Context.getDrawable(Context.java:459)
at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:2)
at org.mozilla.fenix.browser.BrowserFragment.initializeUI(BrowserFragment.kt:6)
at org.mozilla.fenix.browser.BaseBrowserFragment.onViewCreated(BaseBrowserFragment.kt:1)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:21)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:25)
at androidx.fragment.app.FragmentManager.addAddedFragments(FragmentManager.java:5)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:53)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:11)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:4)
at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:1)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/$ic_readermode_selected__0.xml from color state list resource ID #0x7f080090
at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2764)
at android.content.res.Resources.loadColorStateList(Resources.java:2713)
at android.content.res.TypedArray.getColor(TypedArray.java:439)
at android.graphics.drawable.VectorDrawable$VFullPath.updateStateFromTypedArray(VectorDrawable.java:1605)
at android.graphics.drawable.VectorDrawable$VFullPath.inflate(VectorDrawable.java:1584)
at android.graphics.drawable.VectorDrawable.inflateInternal(VectorDrawable.java:666)
at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:571)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1215)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1124)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2644)
... 20 more
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #14: invalid color state list tag gradient
at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:217)
at android.content.res.ColorStateList.createFromXml(ColorStateList.java:201)
at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2760)
... 29 more 

cc @sblatz to have a look as this. See the 2nd comment for some good investigation from the reporter.

Hopping on this. Thanks for the report! 😄

Verified as fixed on Nightly 6/12, the app doesn't crash anymore when interacting with URL bar/search/loading pages.
Affected devices:

  • Huawei MediaPad M2 (Android 5.1.1)
  • Samsung Galaxy Tab A6 (Android 5.1.1)
Was this page helpful?
0 / 5 - 0 ratings