问题描述
这是关于用户的Firebase Crashlytics报告,我无法使其崩溃。每次都对我有用。
InflateException: Binary XML file line #19: Binary XML file line #19:
Error inflating class androidx.appcompat.widget.AppCompatImageButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
Caused by: Resources$NotFoundException: Drawable com.inadaydevelopment.herdboss:drawable/button_close_24dp
with resource ID #0x7f08006d
Caused by Resources$NotFoundException: File res/drawable/button_close_24dp.xml
from drawable resource ID #0x7f08006d
Caused by Resources$NotFoundException: Drawable (missing name)
with resource ID #0x7f08006e
Caused by Resources$NotFoundException: Unable to find resource ID #0x7f08006e
at android.content.res.ResourcesImpl.getResourceName(ResourcesImpl.java:253)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:760)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:630)
at android.content.res.Resources.loadDrawable(Resources.java:886)
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:953)
at android.content.res.TypedArray.getDrawable(TypedArray.java:928)
at android.content.res.XResources$XTypedArray.getDrawable(XResources.java:1363)
at android.graphics.drawable.StateListDrawable.inflateChildElements(StateListDrawable.java:177)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:122)
我相信resource ID #0x7f08006d
是res/drawable/button_close_24dp.xml
中定义的选择器:
<?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/button_close_grey_24dp" />
<item android:drawable="@drawable/button_close_white_24dp" />
</selector>
它引用@drawable/button_close_grey_24dp
和@drawable/button_close_white_24dp
,其中之一必须为resource ID #0x7f08006e
,这是异常根源。
每个资源都有两个版本,res/drawable
中的png和res/drawable-nodpi
中可绘制的xml向量。
据我所知,所有资源均已存在且位置适当,以便新设备或旧设备都可以找到它们。
我想念什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)