• Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

422
Views
Manifest merger failed for <receiver> when migrating to android 12 despite adding android: exported flag

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.

11 months ago · Santiago Trujillo
1 answers
Answer question

0

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:

  • Lower the version in your gradle to 30 and sync and build.
  • Go to your AndroidManifest.xml file and click on "Merged Manifest".
  • Find items that don't have "android:exported" attribute.
  • Then add them to your AndroidManifest.xml file in this way.
<activity
    android:name="SomeActivity"
    android:exported="false"
    tools:node="merge"
    tools:replace="android:exported" />

Now you can increase your version to 31.

11 months ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.