Splash screen is not showing after adding to launch_background.xml

Added the below code to launch_background.xml for adding splash screen in Flutter. But it does not show any splash screen on mobile app launch.

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/white" />

    <!-- You can insert your own image assets here -->
    <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable/launcher" />
    </item>
</layer-list>
1 Answers

You also need to add same code in drawable-v21 > launch_background.xml file. Because Android will use this file for higher version of android.

Never leave your website again in search of code snippets by installing our chrome extension.