Resources $ NotFoundException:仅在启动背景三星8.0.0设备上

时间:2019-01-05 08:53:11

标签: android

崩溃仅在Samsung 8.0.0设备上发生,我没有使用任何矢量可绘制。

主题斜线是

<style name="Theme_Splash" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:colorPrimaryDark">@color/bar_style</item>
    <item tools:targetApi = "23" name="android:windowLightStatusBar">true</item>
    <item name="android:windowBackground">@drawable/splashbackground</item>
    <item name="android:windowContentOverlay">@null</item>

</style>

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.ui.SplashActivity}: android.content.res.Resources$NotFoundException: Drawable com.example:drawable/splashbackground with resource ID #0x7f08088c
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
   at android.app.ActivityThread.-wrap11(Unknown Source)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
   at android.os.Handler.dispatchMessage(Handler.java:105)
   at android.os.Looper.loop(Looper.java:164)
   at android.app.ActivityThread.main(ActivityThread.java:6942)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

1 个答案:

答案 0 :(得分:0)

检查您的 splashbackground 图片文件。很有可能在 drawable-hdpi mdpi 或类似文件夹中,而不是在 drawable 文件夹中。

将其移动到 drawable 文件夹应该可以解决问题