Hello All, I am trying migrating my app to android...
# android
a
Hello All, 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.
Copy code
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.
😶 3
r
You can view the merged manifest, go to the manifest, there should be another tab at the bottom
a
@Rak Yes, I checked in merged manifest . But all activities/service/receiver tags has
android:exported
in it.
p
@Akhil Jain The following steps worked for me and hope it works for you too. Cheers! • Downgrade targetSdkVersion from 31 to 30 • Open AndroidManifest.xml and tap on “Merged Manifest” tab at the bottom. More info https://developer.android.com/studio/build/manage-manifests#inspect_the_merged_manifest_and_find_conflicts. • Check the merged manifest file for any missing android:exported attribute. • Add android:exported anywhere that’s applicable. • If the missing attribute is not in your codebase’s AndroidManifest.xml but in a dependency’s AndroidManifest.xml , update the dependency version. • Now upgrade the targetSdkVersion to 31 and compile your app. Here is one dependencies I had to update to support this migration. • androidx.testrules
a
Hey @Priya, I tried downgrading targetSdkVersion to 30 and checked AndroidManifest file. But I found no missing
android:exported
attribute.
I'll also try upgrading the above mentioned dependency
p
Did you check in your app’s “merged manifest” file? As shown here at the bottom tab https://developer.android.com/studio/build/manage-manifests#inspect_the_merged_manifest_and_find_conflicts.
a
I have checked in merged manifest file present in bottom tab but haven't gone through one present in below mentioned directory. I'll verify that also
👍 1
a
Hey mate! Is there any update on that? Could you fix it?