I just about to make a splash screen, and i made it in VSCode instead of android studio because i'm using flutter as SDK. I manually imported the image (drag and drop) and change somethings in styles.xml and launch_background.xml (since it is the splash screen) and i got this error

E:\Git\kene\android\app\src\main\res\drawable\launch_background.xml: AAPT: error: '@drawable\logos.png' is incompatible with attribute android:src (attr) reference|color.

E:\Git\kene\android\app\src\main\res\drawable\launch_background.xml:0: error: '@drawable\logos,png' is incompatible with attribute android:src (attr) reference|color.
error: failed linking file resources.
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
...

here is my styles.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
    <!-- Show a splash screen on the activity. Automatically removed when
         Flutter draws its first frame -->
    <item name="android:windowBackground">@drawable/launch_background</item>
    <item name="android:windowFullscreen">true</item>
</style>
</resources>

and here is my launch_background.xml

 <?xml version="1.0" encoding="utf-8"?>
   <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@android:color/white" />
    <!-- You can insert your own image assets here -->
    <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable\logos.png" />
    </item>
    </layer-list>

and I can make sure that the file name is correct and the file is located at /src/main/res/drawable


Solution 1: Venkata Narayana

Replace the backward slash with a forward slash @drawable/logos.png in launch_background.xml bitmap android:src attribute


Solution 2: user3875913

Remove .png from your file name inside the launch_background.xml like so:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<item>
    <bitmap
        android:gravity="center"
        android:src="@drawable\logos" />
</item>
</layer-list>