Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
AppCompatActivity
If we set the window background of the theme of an
AppCompatActivity
to a vector drawable with gradient tag (which is supported officially API 24+) in the XML file, the activity would crash duringonCreate()
.We assume that
AppCompat
useVectorDrawableCompat
, etc. for bug fixes and feature backports.Below are the error logs:
Possible causes:
androidx.appcompat.app.AppCompatDelegateImpl.attachToWindow()
appears to get the drawable of window background by means ofandroidx.appcompat.widget.TintTypedArray.getDrawableIfKnown()
. This method, in turn, depends onandroid.content.res.AssetManager.getResourceValue()
, which calls the native functionandroid.content.res.AssetManager.loadResourceValue()
. The return value of the native function was casted fromssize_t
tojint
, butgetResourceValue()
got a negative integer. As a result,android.content.res.Resources.getValue()
threw aNotFoundException
.A minimal working example is attached as a ZIP archive.