Skip to content Skip to sidebar Skip to footer

Windowsplashscreenanimatableicon Not Found

I want to customize my splash screen on Android 12 and I get the AAPT error: AAPT: error: style attribute 'android:attr/windowSplashScreenAnimatableIcon' not found. Here is the re

Solution 1:

It seems that the documentation is wrong/outdated. The right attribute is:

<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash</item>

The correct attribute is listed in the R.attr class.


In a previous version of this answer I had a way to keep the splashscreen working as before, however this does not work anymore.

Today I suggest to use the splash compat library and this style:

<stylename="SplashTheme"parent="Theme.SplashScreen"><itemname="windowSplashScreenBackground">@color/ic_launcher_background</item><itemname="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item><itemname="postSplashScreenTheme">@style/Your.Normal.Theme</item></style>

This has the two assumptions that you use a adaptive launcher icon with the default namings. In my case ic_launcher_background is a solid color this is why I'm using color instead of drawable prefix. I hope that helps others.

Here is the guide for the splash migration from Google.

Solution 2:

This happens if you add android12: true in your pubspec.yaml

Solution 3:

For anyone who has issues customising splash screen make sure you are using the correct parent theme

Instead of

<stylename="SplashTheme"parent="@style/Theme.MaterialComponents.DayNight.NoActionBar"><itemname="android:windowSplashScreenAnimatableIcon">@drawable/ic_splash</item></style>

use

<stylename="SplashTheme"parent="Theme.SplashScreen"><itemname="android:windowSplashScreenAnimatableIcon">@drawable/ic_splash</item><itemname="postSplashScreenTheme">@style/Your.Normal.Theme</item></style>

Post a Comment for "Windowsplashscreenanimatableicon Not Found"