'Apps targeting Android 12 and higher are required to specify an explicit value for 'android:exported' but I have such value

When I'm trying to compile an APK file I get the next error: dove\frontend\android\src\main\AndroidManifest.xml Error: 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.

I have such value, but AGP does not see it. My manifest with value:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.dove.android">

    <application
            android:name=".DoveApplication"
            android:allowBackup="true"
            android:fullBackupContent="true"
            android:icon="@mipmap/ic_launcher"
            android:label="Dove"
            android:supportsRtl="true"
            android:theme="@style/Theme.Dove">
        <activity
                android:exported="true"
                android:name=".AppActivity"
                android:label="Dove"
                android:theme="@style/Theme.Dove.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

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

</manifest>

AGP version: 4.2.2 Any workarounds except of downgrading targetSdk?



Solution 1:[1]

most likely because of react-native version. I had same issue on react-native 0.63.4, but no error on react-native 0.66.4

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 a short man