I am using flutter_native_splash in my Flutter project. The splash screen works perfectly on Android 11 and below, but on Real Android 12 devices and above, the logo does not appear on the first app launch — only the background color is displayed.
However, from the second launch onwards, the splash screen shows the logo and background color correctly.
Has anyone faced this issue? How can I make the logo appear even on the very first launch on Android 12+?
My yaml code : -
flutter_native_splash:
image: assets/loginPage/splashScreenELogo.png
color: "#5C7CFF"
color_dark: "#5C7CFF"
fullscreen: true
android_12:
image: assets/loginPage/splashScreenELogo.png
color: "#5C7CFF"
color_dark: "#5C7CFF"
fullscreen: true
My manifest code : -
<application
android:label="CGPEY"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
My png properties : -
Dimensions : 512 x 511
bit depth : 32
size : 8.8 kb
I have implement what @iamgoddey told me to
my v-31 xml code : -
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#5C7CFF</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash</item>
</style>
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
I have also downloaded the source code from this tutorial : - https://www.youtube.com/watch?v=lLFaZfI-NwI&ab_channel=ManojKulkarni , this too does not work for android 12 and plus.
android:windowSplashScreenAnimatedIcon, but Android caches the splash drawable only after the first run. So, if the generated resource is too large, not in the right format, or not properly referenced in your theme, Android falls back to background color on first launch.