Question

Flutter v2.5.0 Android Splash Screen

I had implemented a native splash screen in my current project and everything was working correctly since I upgraded to v2.5.0 and I am starting to get this deprecation warning on my console:

A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.

I have checked out the given link (which is not that clear btw) and tells me to remove the o.flutter.embedding.android.SplashScreenDrawable API as flutter now automatically displays the splash.

But after running my app without the code no splash screen appears moreover it takes a while to start the app - probably initializing the app without the splash or something.

Am I doing this right or is it an issue with the framework itself?

 46  31554  46
1 Jan 1970

Solution

 67

It is caused by having the following code in your AndroidManifest.xml, which was included by default in previous versions of Flutter:

<meta-data
    android:name="io.flutter.embedding.android.SplashScreenDrawable"
    android:resource="@drawable/launch_background"
/>

The solution is to remove the above code.

Source

2021-10-01

Solution

 12

Follow this youtube tutorial on how to correctly Create Splash Screen in Flutter App the Right Way in 2021. Ensure to create the launch_background.xml file in both drawable and drawable-v21 folders inside the android/app/src/main/res folder.

Create Splash Screen in Flutter App the Right Way in 2021

If you are using Flutter 2.5, remove the following line in your AndroidManifest.xml file since Flutter 2.5 has no need for it anymore as mentioned here --> android splash migration

<meta-data
 android:name="io.flutter.embedding.android.SplashScreenDrawable"
 android:resource="@drawable/launch_background"/>
2021-10-21