简体   繁体   中英

android.content.res.Resources$NotFoundException: Drawable compat_splash_screen_no_icon_background with resource ID #0x7f0801b6

I am getting this issue only for samsung galaxy devices- Galaxy Tab A, Galaxy A03 Core, Galaxy A02, Galaxy A32

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.application/com.myapp.application.ui.MainActivity}: android.content.res.Resources$NotFoundException: Drawable com.app.application:drawable/compat_splash_screen_no_icon_background with resource ID #0x7f0801b6

My configuration->

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
    <style name="Theme.App.Starting" parent="Theme.SplashScreen">
        <item name="windowSplashScreenBackground">@color/white</item>

        <item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>

        <item name="postSplashScreenTheme">@style/Theme.Triva.NoActionBar</item>
        <item name="windowSplashScreenIconBackgroundColor">@color/blue</item>
        <item name="windowSplashScreenAnimationDuration">800</item>

        <item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
    </style>
</resources>

This is the resource in read only file ->

在此处输入图像描述

在此处输入图像描述

This is currently an issue. You will have to wait a bit for the fix to ship, then update the core-splashscreen dependency to the latest version.

It is tracked here https://issuetracker.google.com/issues/229645249 See if the call order they suggest there helps you mitigate the problem.

Try to rename the resource file. Looks like it interferes with some of Samsung's resource files and you have such runtime error.

The background must be a color value, drawables are not supported (at least for now). You can review the example in docs ( https://developer.android.com/guide/topics/ui/splash-screen )

working example:

<item name="windowSplashScreenBackground">@color/colorPrimary</item>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM