LoginSignup
3
0

More than 1 year has passed since last update.

【Flutter】"A splash screen was provided to Flutter, but this is deprecated."を解消する

Posted at

先日Flutterのバージョンを2.2.3から2.8.0に上げてから、A splash screen was provided to Flutter, but this is deprecated.
とコンソール上にログが表示されるようになったので、少し調べてみました。

概要

公式ドキュメント

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 usage of these APIs.

どうやらFlutter v2.5.0以前のFlutter製Androidアプリでは、デフォルトだとFlutterが最初のフレームを描画するまでの間に一瞬スプラッシュ画面を表示するようでした。
今後はFlutterが最初のフレームを描画するまでの間、Android側で起動画面を自動的に表示し続けるようになったので、io.flutter.embedding.android.SplashScreenDrawableのAPIが非推奨になったようです。

対処法

AndroidManifest内の該当箇所を削除する

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

上記箇所を削除することで解消しました:relaxed:

参考

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0