Flutter app shows a black screen before loading the app

11,819

Solution 1

This issue was fixed recently. If you are using a version of Flutter that has this engine fix, you won't see the black frame. (The fix should be on the Flutter master branch by now, but not the alpha branch.)

Solution 2

It's not issue, this for hot reload. Don't worry about that. When you run with release, you can't see this.

if you want to be sure try ->

flutter run --release

Solution 3

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

AndroidManifest.xml check the FlutterActivity and add this code

Solution 4

It's not a bug. That's the way it behaves normally. You can replace the loading black screen with an image:

In AndroidManifest.xml, here is where you can change your splash image.

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

Find the files:

android\app\src\main\res\drawable\launch_background.xml

android\app\src\main\res\drawable-v21\launch_background.xml

Change the files to add your own custom image:

<item>
    <bitmap android:gravity="center" android:src="@drawable/splash_image" />
</item>

Your splash image should be stored in the drawable folders:

android\app\src\main\res\drawable\splash_image.png

app\src\main\res\drawable-v21\splash_image.png

Share:
11,819

Related videos on Youtube

Abhijeet
Author by

Abhijeet

Updated on September 15, 2022

Comments

  • Abhijeet
    Abhijeet over 1 year

    I have noticed this problem with flutter apps, when I open a flutter app from cold boot, I see a black screen popping before the actual app is loaded. I have seen the problem with the Newsvoice production app and as well as with a test app I installed.

    Check the video here: https://www.youtube.com/watch?v=zszud6UWzps

    Is it a bug in the Flutter SDK?

  • Sisir
    Sisir about 4 years
    May be you should not start your answer with 'It's not issue' because it totally is, only in debug mode though. The release mode part is helpful
  • DolDurma
    DolDurma over 3 years
    what's my_splash?
  • Akash Neeli
    Akash Neeli over 2 years
    This Worked for me. But, I had to remove 'android:gravity="center" ' for a perfect render.