. Advertisement .
..3..
. Advertisement .
..4..
Java is a general-purpose and object-oriented programming language developed for distributed environments and software development for consumer electronics such as TVs, VCRs.
When you try to do anything automated in the tool, the following error appears: 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 in Java. Don’t worry too much. This post will support you in resolving the error with the best solution.
When Will 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 in Java” Occur?
You recently updated my emulator and Android SDK, and now you cannot run your simple hello world project due to the following 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.***
The Effective Method For 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 in Java”.
Specify android:exported=”false” or android:exported=”true” in androidmanifest
Below is the best solution to solve ”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 in Java”. Let’s follow this process to further understand this method.
To run your applications on Android 12, you simply need to specify android:exported=”false” or android:exported=”true” in androidmanifest.
If “true”, the activity can access to any apps and launch them with their accurate class name.
If “false”, only parts of the same program, applications using the same user ID, or privileged system parts are able to initiate the activity. When no intent filters exist, this is the defaulted value.
In the case the activity in your app contains intent filters, you need to set this element to “true” to enable other apps to initiate it. For instance, if it is the most important activity of the app and consists of the class “android.intent.category.LAUNCHER”. The system will raise an ActivityNotFoundException in the situation this element is defaulted to “false” and an app attempts to initiate the activity.
And your manifest will appear as follows:
<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>
Now, your problem has been solved effectively.
Conclusion
The simple approach presented above is a simple solution to the aforementioned major 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 in Java“.
Please leave all your concerns in the comments section if you have any further questions. I wish you all an effective day with your tool.
Leave a comment