Search code examples
flutterandroid-12

Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]


While debugging the application in android 12, the app is getting crashed.


Solution

  • Android 12 require you to add a piece of code to your main activity

    1. Go to your project folder and open AndroidManifest.xml file

    2. Add the below code in activity

      android:exported="true"

    Reference:

       <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme">
        </activity>