英文:
"Drawable not found" crashing issue in Android 4 version
问题
在 Firebase Crashlytics 中,我在 Android 版本 4 的手机上遇到以下错误。
文件 ic_arrow_back_black_24dp.xml 存在于 drawable 文件夹中。请帮忙解决。
https://prnt.sc/sauoit
图片中展示了现有的文件夹。
谢谢
Fatal Exception: java.lang.RuntimeException: 无法启动组件信息{com.defaultmailproject.myproject/com.defaultmailproject.myproject.ui.activities.MainActivity}:android.content.res.Resources$NotFoundException:来自可绘制资源 ID #0x7f0800c9 的文件 res/drawable-hdpi-v4/ic_arrow_back_black_24dp.xml
Fatal Exception: java.lang.RuntimeException: 无法启动组件信息{com.defaultmailproject.myproject/com.defaultmailproject.myproject.ui.activities.MainActivity}:android.content.res.Resources$NotFoundException:来自可绘制资源 ID #0x7f0800c9 的文件 res/drawable-xxhdpi-v4/ic_arrow_back_black_24dp.xml
Fatal Exception: java.lang.RuntimeException: 无法启动组件信息{com.defaultmailproject.myproject/com.defaultmailproject.myproject.ui.activities.MainActivity}:android.content.res.Resources$NotFoundException:来自可绘制资源 ID #0x7f0800c9 的文件 res/drawable-v19/ic_arrow_back_black_24dp.xml
MainActivity 中的工具栏 ic_arrow_back_black_24.dp.xml;
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
final Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_black_24dp);
upArrow.setColorFilter(getResources().getColor(R.color.white), PorterDuff.Mode.SRC_ATOP);
英文:
In Firebase Crashlytics, I get the following error on Android version 4 phones.
The file ic_arrow_back_black_24dp.xml exists in drawable folders. Please help.
https://prnt.sc/sauoit
Existing folders are available in the picture.
Thanks
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.defaultmailproject.myproject/com.defaultmailproject.myproject.ui.activities.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable-hdpi-v4/ic_arrow_back_black_24dp.xml from drawable resource ID #0x7f0800c9
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.defaultmailproject.myproject/com.defaultmailproject.myproject.ui.activities.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable-xxhdpi-v4/ic_arrow_back_black_24dp.xml from drawable resource ID #0x7f0800c9
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.defaultmailproject.myproject/com.defaultmailproject.myproject.ui.activities.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable-v19/ic_arrow_back_black_24dp.xml from drawable resource ID #0x7f0800c9
MainActivity Toolbar ic_arrow_back_black_24.dp.xml;
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
final Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_black_24dp);
upArrow.setColorFilter(getResources().getColor(R.color.white), PorterDuff.Mode.SRC_ATOP);
答案1
得分: 1
请确保文件 "ic_arrow_back_black_24.dp.xml" 位于 drawable 文件夹中,而不是 drawable-v24 文件夹中。只需将其从 drawable-v24 文件夹中剪切并粘贴到 drawable 文件夹中。
英文:
make sure that file
ic_arrow_back_black_24.dp.xml
is in drawable folder not in drawable-v24
just cut it from drawable-v24 and paste it in drawable
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论