Splash Screen is not showing on Android 12 and Below but Splash Screen Working on Android 13 and Above

Omkar Pawar 100 Reputation points
2025-01-16T04:57:21.1433333+00:00

Hello,

I am facing an issue where my splash screen works correctly on Android 13 and above, but when I try to run my app on Android 12 and below, I just see a blank screen.

Previously, I encountered issues after installing the APK where the splash screen wouldn't show properly. After asking for help, (NET MAUI Splash Screen Not Displaying logo.png on Android 14 and 15) provided a solution that worked for Android 13 and above, but now I can not get the splash screen to show on devices running Android 12 or lower.

Here’s a simplified version of my code:
splash_icon.xml

<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:gravity="center"
        android:width="100dp"
        android:height="100dp"
        android:drawable="@drawable/splashlog" />
</layer-list>

styles.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
    <style name="CustomSplashTheme" parent="Maui.SplashTheme">
        <!-- To turn off the highlight color -->
        <item name="android:colorControlHighlight">@android:color/transparent</item>
        <!-- To turn off the application title bar -->
        <item name="windowNoTitle">true</item>
        <!-- To enable working with SplashScreen -->
        <item name="android:windowBackground">@drawable/maui_splash</item>
        <!-- To set the splash background color -->
        <item name="android:windowSplashScreenBackground">@color/colorAccent</item>
        <!-- Copy your splash icon to the /Platform/Android/Resources/Drawable folder, and set the build action to AndroidResource -->
        <item name="android:windowSplashScreenAnimatedIcon">@drawable/splasn_icon</item>
    </style>
</resources>

MainActivity.cs

[Activity(Theme = "@style/CustomSplashTheme", MainLauncher = true, LaunchMode =...)]
public class MainActivity : MauiAppCompatActivity
{
}

User's image

Has anyone encountered a similar problem or have suggestions on how to ensure the splash screen works on Android 12 and below? I have already read the official Android documentation on splash screens (link), but I have not been able to fix the issue. Any help would be greatly appreciated!

Thank you in advance!

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,834 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 78,671 Reputation points Microsoft Vendor
    2025-01-17T05:10:38.4366667+00:00

    Hello,

    ===============Update================= For android 10, please open your styles.xml, change the value of `` <item name="android:windowBackground">@drawable/maui_splash</item>to <item name="android:windowBackground">@drawable/splasn_icon</item>, then if you want to custom background color for splash screen, please open the splash_icon.xml` add following lines

    <?xml version="1.0" encoding="utf-8" ?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android"  >
    
    <!--set splashscreen background color-->
    <item>
    <color android:color="@color/colorPrimary" />
    </item>
    
    <item
            android:gravity="center"
            android:width="100dp"
            android:height="100dp"
            android:drawable="@drawable/splashlog" />
    </layer-list>
    

    Android 12 does not show the splash screen icon when debugging the application from Visual Studio. However, if you stop debug and close your application in the recent running application page. Then reopen your application, this splash screen will appear normally. And if you generate APK and install it, then open your application, this splash screen will show normally. This issue only happened in the debug mode with IDE.

    By the way, I test this issue in the android studio with a native android project as well, when I debug it in Android studio, I will get the same issue, this is a native android issue.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.