【发布时间】:2020-08-29 21:18:28
【问题描述】:
在 Google Play 商店中,我可以在某些设备(Android 8.0 和 8.1)上看到以下崩溃日志输出。但是,我无法找出原因,因为日志输出和所有可绘制文件夹(hdpi、mdpi、xhdpi、xxhdpi、xxxhdpi)中缺少可能丢失的资源 ID,我有必要的 PNG 图像。
你知道可能是什么原因吗?
Caused by: android.content.res.Resources$NotFoundException:
at android.content.res.ResourcesImpl.getValue (ResourcesImpl.java:215)
at android.content.res.Resources.getValue (Resources.java:1316)
at androidx.appcompat.widget.ResourceManagerInternal.createDrawableIfNeeded (ResourceManagerInternal.java:176)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable (ResourceManagerInternal.java:141)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable (ResourceManagerInternal.java:132)
at androidx.appcompat.content.res.AppCompatResources.getDrawable (AppCompatResources.java:104)
at com.google.android.material.tabs.TabLayout$Tab.setIcon (TabLayout.java:1968)
at com.xyz.myapp.MainActivity.setupTabIcons (MainActivity.java:184)
at com.xyz.myapp.MainActivity.initialize (MainActivity.java:176)
at com.xyz.myapp.MainActivity.onRequestPermissionsResult (MainActivity.java:453)
at android.app.Activity.dispatchRequestPermissionsResult (Activity.java:7429)
at android.app.Activity.dispatchActivityResult (Activity.java:7280)
at android.app.ActivityThread.deliverResults (ActivityThread.java:4264)
【问题讨论】:
标签: java android android-drawable android-resources android-tablayout