'Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported`

Please help me with this error getting in my project while trying to run at mobile via android studio.

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.



Solution 1:[1]

I found this solution!!.

So you have to add the android:exported="true" into the activity tag in the manifest (not in the application).

<application
        android:fullBackupContent="@xml/my_backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name">
        <activity android:name=".yourActivity" android:exported="true">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".otherActivity" android:exported="true"/>

    </application>

To see more information about the exported property, see App manifest file activity

:)

Solution 2:[2]

add this to your manifest:

android:exported="true"

this happens when your activity can be started by another application. for example image viewer can be started by file manager when clicking an image. the image viewer app is "exported".

Solution 3:[3]

If you have any activity, service, receiver, or provider that does not have exported set in your manifest file then add whenever it needed like,

android:exported="false or true"

Solution 4:[4]

You had to figure out the component missing the Android exported tag. You should downgrade your SDK version and check the final merged manifest file for the components missing the exported tag but has IntentFilter.

The step-by-step instructions is provided in this link.

Solution 5:[5]

if you are using flutter ,may some deprecated lib in your ap is causing this .. for me: upgrading flutter_local_notifications to the latest version (now is 9.3.2) solved this error..

Solution 6:[6]

This is for the projects using Bootsplash. My project used Bootsplash and I solved it by adding android:exported="true" also to the activity of Bootsplash in the AndroidManifest file.

<application
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustPan"
    android:exported="true"                   // <----ADD THIS
    android:screenOrientation="portrait">
    
  </activity>
   <activity
    android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
    android:theme="@style/BootTheme"
    android:exported="true"                    // <----ADD THIS
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>
</application>

Solution 7:[7]

Add android:exported="true" into the Manifest file inside of the application activity

<application

    <activity
        android:exported="true"
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/Theme.NoteKeeper.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 AIMIN PAN
Solution 3 Hardik Hirpara
Solution 4 Praj
Solution 5 Amer AlZibak
Solution 6
Solution 7 Adesipe Adeola