Issue
I hava updated my emulator version and Android SDK version to Android S (Android 12). After the update, I cannot run the project. I cannot run a hello world project (empty project), but I can build Grades as well as but can not run the project. I always got the error :
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.
Please anyone can help me?
Here is a screenshot:
So the question is how to solve this issue when using android 12 SDK? question is about the issue after applying the solution to this, This question is different than the question mentioned with the duplicate also this question is oldest than this
Solution
You need to specify android:exported="false"
or android:exported="true"
Manifest:
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.MyApplication.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
as mentioned in the document
If your app targets Android 12 and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android: exported attribute for these app components.
Warning: If an activity, service, or broadcast receiver uses intent filters and doesn't have an explicitly-declared value for android:exported, your app can't be installed on a device that runs Android 12.
Also check when to use true/false for 'android:exported' value
Answered By - Mittal Varsani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.