Deprecated Splash Screen API Migration
Prior to Flutter 2.5, Flutter apps could add a splash
screen by defining it within the metadata of their application manifest file
(AndroidManifest.xml), by implementing provideSplashScreen
within
their FlutterActivity, or both. This would display momentarily in between
the time after the Android launch screen is shown and when Flutter has
drawn the first frame. This approach is now deprecated as of Flutter 2.5.
Flutter now automatically keeps the Android launch screen displayed
until it draws the first frame.
To migrate from defining a custom splash screen to just defining a custom launch screen for your application, follow the steps that correspond to how your application's custom splash screen was defined prior to the 2.5 release.
Custom splash screen defined in FlutterActivity
-
Locate your application's implementation of
provideSplashScreen()within itsFlutterActivityand delete it. This implementation should involve the construction of your application's custom splash screen as aDrawable. For example:java@Override public SplashScreen provideSplashScreen() { // ... return new DrawableSplashScreen( new SomeDrawable( ContextCompat.getDrawable(this, R.some_splash_screen))); } -
Use the steps in the section directly following to ensure that your
Drawablesplash screen (R.some_splash_screenin the previous example) is properly configured as your application's custom launch screen.
Custom splash screen defined in Manifest
-
Locate your application's
AndroidManifest.xmlfile. Within this file, find theactivityelement. Within this element, identify theandroid:themeattribute and themeta-dataelement that defines a splash screen as anio.flutter.embedding.android.SplashScreenDrawable, and update it. For example:xml<activity // ... android:theme="@style/SomeTheme"> // ... <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/some_splash_screen" /> </activity> -
If the
android:themeattribute isn't specified, add the attribute and define a launch theme for your application's launch screen. -
Delete the
meta-dataelement, as Flutter no longer uses that, but it can cause a crash. -
Locate the definition of the theme specified by the
android:themeattribute within your application'sstyleresources. This theme specifies the launch theme of your application. Ensure that thestyleattribute configures theandroid:windowBackgroundattribute with your custom splash screen. For example:xml<resources> <style name="SomeTheme" // ... > <!-- Show a splash screen on the activity. Automatically removed when Flutter draws its first frame --> <item name="android:windowBackground">@drawable/some_splash_screen</item> </style> </resources>
Unless stated otherwise, the documentation on this site reflects Flutter 3.35.5. Page last updated on 2025-10-28. View source or report an issue.