This error occurs when an activity, service, broadcast receiver, or content provider does not explicitly specify the exported attribute. The exported attribute specifies whether a component can be launched or bound by components outside of the application.
In order to fix this issue, you will need to add the exported attribute and set it to true for all components that you want to be accessible outside of the application. For example, if you have an activity that you want to be able to be launched from another application, you would add the following line to the manifest file:
<activity android:name=".MainActivity" android:exported="true" />
This error is introduced in Android 12, which requires developers to explicitly specify the exported attribute for all components that have an intent filter defined. This is because Android 12 has a new security feature that prevents components from being launched or bound by components outside of the application unless the exported attribute is explicitly set to true.
Here's a step-by-step guide on how to fix the error:
Once you have made these changes, the error should be resolved.
The above is the detailed content of Why is my Android app throwing an 'exported attribute not specified' error in Android 12?. For more information, please follow other related articles on the PHP Chinese website!