1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Splash screen with flutter not working. App icon is missing

Discussão em 'Mobile' iniciado por Stack, Outubro 17, 2024 às 11:42.

  1. Stack

    Stack Membro Participativo

    I am trying to make the splash work for my app. here my files:

    drawable/launch_background.xml

    <?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/splash_background" />

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


    drawable-v1/launch_background.xml

    <?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/splash_background" />

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


    values/styles.xml

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
    <item name="android:windowBackground">@drawable/launch_background</item>
    </style>
    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
    <item name="android:windowBackground">?android:colorBackground</item>
    </style>
    </resources>


    The ic_launcher.png is present in mipmap-hdi, mipmap-mdpi, mipmap-xhdpi, mipmap-xxhdpi and mipmap-xxxhdpi folders. I would like not to use the flutter_native_splash package. On Samsung Galaxy 7 with api level 25 and android version 8.0 I only see a screen with the splash_background color. The icon is not being displayed. On Samsung Galaxy 20 with api level 36 and android version 13.0 it works fine. In android studio emulator api level 33 and android version 13 it also works fine.

    If I uncomment the bitmap in drawable-v1/launch_background.xml I get a dark screen as splash screen.

    Continue reading...

Compartilhe esta Página