androidflutterdynamic-links

Flutter Dynamic Links not opening on Android devices running Android 13, but working fine on devices below Android 13. How to fix this issue


Hello Stack Overflow community,

I am currently facing an issue with Flutter Dynamic Links on Android devices running Android 13. The dynamic links are working perfectly on devices with Android versions below 13, but they fail to open on newer Android versions. Here's a simplified version of my AndroidManifest.xml code:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:name="${applicationName}"
    android:icon="@mipmap/ic_launcher"
    android:label="Plus One"
    android:usesCleartextTraffic="true">
    <activity
        android:name=".MainActivity"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:exported="true"
        android:hardwareAccelerated="true"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:windowSoftInputMode="adjustResize">

        <!-- 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 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="plone.page.link"/>

            <data
                android:scheme="http"
                android:host="plone.page.link"/>
        </intent-filter>

        <meta-data
            android:name="flutter_deeplinking_enabled"
            android:value="true"/>
    </activity>

    <activity
        android:name="com.yalantis.ucrop.UCropActivity"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

    <!-- 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>

<queries>
    <intent>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="https"/>
    </intent>
</queries>

Solution

  • Update Android targetSdkVersion to 33