skip to Main Content

I am not using any special packages, just the default Android methods but on Android 12 2 logos appear one after the other.

Here below are my different files used androidappsrcmainresvaluesstyles.xml:

The first splash screen is very small and loads for a very short period <200ms while the other one is the normal size as it appears on phones < android 12.

Not sure what i need to change here. My styles was supposed to be compatible with Android 12. Any ideas?

<?xml version="1.0" encoding="utf-8"?>
<resources>
    
    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">@drawable/launch_screen</item>
        <item name="android:windowFullscreen">false</item>
    </style>
    
    <!-- Theme applied to the Android Window as soon as the process has started. This theme determines the color of the Android Window while your Flutter UI initializes, as well as behind your Flutter UI while its running. This Theme is only used starting with V2 of Flutter's Android embedding  -->
    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">?android:colorBackground</item>
    </style>
    
</resources>

manifest file:

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="biz.my.app.android">
    
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    
    <!-- NB:adding the android:exported property is very important -->
    <application
    android:label="My App"
    android:icon="@mipmap/ic_launcher"
    tools:replace="android:label"
    android:usesCleartextTraffic="true">
        
        <!-- default activity -->
        <activity
        android:name=".MainActivity"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
            
            <!-- Displays an Android View that continues showing the launch screen Drawable until Flutter paints its first frame, then this splash screen fades out. A splash screen is useful to avoid any visual gap between the end of Android's launch screen and the painting of Flutter's first frame. -->
            <meta-data
                android:name="io.flutter.embedding.android.SplashScreenDrawable"
                android:resource="@drawable/launch_screen"
            />
            
            <!-- Specifies an Android theme to apply to this Activity as soon as the Android process has started. This theme is visible to the user while the Flutter UI initializes. After that, this theme continues to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme"
            />
            
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="zanduclientmobile" android:host="openapp" android:path="/"/>
            </intent-filter>
            
            <!-- Branch.io App Links (optional) -->
            <!-- example-alternate domain is required for App Links when the Journeys/Web SDK and Deepviews are used inside your website.  -->
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="https" android:host="zandumobileclient.app.link" />
                <data android:scheme="https" android:host="zandumobileclient-alternate.app.link" />
            </intent-filter>
            
        </activity>
        
        <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
        android:name="flutterEmbedding"
        android:value="2"
        />
        
    </application>
    
</manifest>

First loading screen
Second loading screen

2

Answers


  1. Starting in Android 12, the SplashScreen API lets apps launch with animation, including an into-app motion at launch, a splash screen showing your app icon, and a transition to your app itself. Complete Reference

    Login or Signup to reply.
  2. If your Flutter app was created prior to Flutter 2.5, you may need to follow these instructions to migrate to the current implementation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search