I am trying migrating my app to android 12 by changing the target SDK version to 31 in build.gradle.
As required, I have added android:exported
flag to every activity/receiver/services/provider tags present in my manifest file. But still I am getting this error.
Manifest merger failed : android:exported needs to be explicitly specified for <receiver>. 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.
So I am guessing this issue is due to any 3rd party library whose manifest contains a receiver without android:exported
flag.
I have also checked merged manifest file for missing android:exported
in components of any third party libraries. But in merged manifest file also all activity/receiver/services tags has exported flag.
So how can I find that missing receiver which is causing the issue.
The reason is because some of the dependency libraries that you're using have elements which do not have "android:exported" attribute.
You need to do this:
<activity
android:name="SomeActivity"
android:exported="false"
tools:node="merge"
tools:replace="android:exported" />
Now you can increase your version to 31.