0
votes

I am new to flutter and recently tried to develop a test app for learning sake with latest version Flutter 2.5. By looking at some tutorial online, I have added flutter_native_splash: ^1.2.3 package for splash screen. And works fine.

However, when I launch app for the first time, it shows following debug message

W/FlutterActivityAndFragmentDelegate(18569): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.

After visiting the above link, I am not able to understand much what is supposed to be done.

Code in pubspec.yaml

flutter_native_splash:
  color: "#FFFFFF"
  color_dark: "#000000"
  image: assets/images/splash_720.png
  android: true
  ios: true
  android12: true

Also, compileSdkVersion and targetSdkVersion is set to 31 in build.gradle

Please help. Thanks in advance.

1

1 Answers

1
votes

Previously, Android Flutter apps would either set io.flutter.embedding.android.SplashScreenDrawable in their application manifest, or implement provideSplashScreen within their Flutter Activity. This would be shown momentarily in between the time after the Android launch screen is shown and when Flutter has drawn the first frame. This is no longer needed and is deprecated – Flutter now automatically keeps the Android launch screen displayed until Flutter has drawn the first frame. Developers should instead remove the usage of these APIs. - source

To avoid that warning you just need to remove that API usage from your project.

Remove these lines of code from the AndroidManifest.xml file.

Code Example