skip to Main Content

I have added the flutter_native_splash package inside my depoendancies and have added this native_splash code in my pubspec.yaml file

flutter_native_splash: ^2.4.0

flutter_native_splash:
  color: "#FFFFFF"
  image: assets/images/Logo.png

  android_12:
    color: "#FFFFFF"
    image: assets/images/Logo.png
  android: true
  ios: true
  web: false

and the results when creating is also showing no errors

Building package executable... (6.0s)
Built flutter_native_splash:create.
[Android] Creating default splash images
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Deleting android12splash.png
[Android] Updating launch background(s) with splash image path...
[Android]  - android/app/src/main/res/drawable/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night/launch_background.xml
[Android]  - android/app/src/main/res/drawable-v21/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night-v21/launch_background.xml
[Android] Updating styles...
[Android]  - android/app/src/main/res/values-v31/styles.xml
[Android]  - android/app/src/main/res/values-night-v31/styles.xml
[Android]  - android/app/src/main/res/values/styles.xml
[Android]  - android/app/src/main/res/values-night/styles.xml
[iOS] Creating  images
[iOS] Updating ios/Runner/Info.plist for status bar hidden/visible

✅ Native splash complete.
Now go finish building something awesome! 💪 You rock! 🤘🤩
Like the package? Please give it a 👍 here: https://pub.dev/packages/flutter_native_splash

despite showing no errors, my native splash screen is still the default flutter splash as seen below

2

Answers


  1. To resolve the default splash screen issue in Android 12, you can replace it with a transparent screen by modifying your styles.xml file. Here are the steps:

    Go to androidappsrcmainresvaluesstyles.xml and edit the file as follows:

    <resources>
    
        <!-- Base application theme. -->
        <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
            <!-- Customize your theme here. -->
            <item name="android:windowBackground">@drawable/launch_background</item>
            <item name="android:windowIsTranslucent">true</item> <!-- add this line -->
        </style>
    
    </resources>
    

    Adding the line <item name="android:windowIsTranslucent">true</item> will make the splash screen transparent, resolving the issue with the default splash screen in Android 12.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search