flutter_native_splash icon indicating copy to clipboard operation
flutter_native_splash copied to clipboard

Android 14 does not display the startup page for the first time

Open parshvas1515 opened this issue 1 year ago • 2 comments

Hello

  • I'm facing same issue when using native splash and run app in dev mode with opening from android studio or taping from launcher icon all time icons shows .
  • When creating relase apk at the very first time it will not show icon it will show only background color and if lunch latter on it will show the splash below is the code snippet for same
flutter_native_splash:
  color: "#FFFFFF"
  image: assets/image/ic_splash_icon_new.png
  color_dark: "#FFFFFF"
  image_dark: assets/image/ic_splash_icon_new.png
  android_gravity: center
  android: true
  ios: true
  image_ios: assets/image/logo.png
  image_dark_ios: assets/image/logo.png
  web: false
  android_12:
    color_dark: "#FFFFFF"
    icon_background_color: "#FFFFFF"
    image: assets/image/ic_splash_icon_new.png

Originally posted by @parshvas1515 in https://github.com/jonbhanson/flutter_native_splash/issues/521#issuecomment-2185725881

parshvas1515 avatar Jun 24 '24 06:06 parshvas1515

Same here, im using firebase app distribution in order to test the app but after the first installation the splash logo doesn't appear, it's just the background color.

flutter_native_splash:
  image: "assets/images/android12splash.png"
  color: "#4308B5"
  android: true
  fullscreen: false
  ios: true
  web: false
  android_12:
    image: "assets/images/android12splash.png"
    color: "#4308B5"

style.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">"@drawable/gradient_background"</item>
        <item name="android:forceDarkAllowed">false</item>
        <item name="android:windowFullscreen">false</item>
        <item name="android:windowDrawsSystemBarBackgrounds">false</item>
        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
        <item name="android:windowSplashScreenBackground">#4308B5</item>
        <item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
    </style>
    <!-- Theme applied to the Android Window as soon as the process has started.
         This theme determines the color of the Android Window while your
         Flutter UI initializes, as well as behind your Flutter UI while its
         running.
         
         This Theme is only used starting with V2 of Flutter's Android embedding. -->
    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">"@drawable/gradient_background"</item>
    </style>
</resources>


Bojan227 avatar Aug 29 '24 10:08 Bojan227

Add this line to your styles.xml file:

<item name="android:windowSplashScreenBehavior">icon_preferred</item>

It is a new setting added in Android 13. More information: https://developer.android.com/develop/ui/views/launch/splash-screen

I think the package should be updated to reflect this.

MichalPleban avatar Apr 09 '25 22:04 MichalPleban