Manifest merger failed because a component with an intent filter has no android:exported
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.Short answer
When your app targets Android 12 (API 31) or higher, every activity, service and broadcast receiver that has an intent filter must declare android:exported. The build stops until it does. Set true for the launcher activity and usually false for the rest. If the component comes from a library, override it in your own manifest.
Fix it fast
1Find out which cause you have
Read the manifest merger report. It names the exact component and the manifest file it came from, which tells you whether it is yours or a library's.
grep -n -B2 -A4 "exported" app/build/outputs/logs/manifest-merger-debug-report.txt2Match what you see, then jump to its fix
- 1
The report points at your app's src/main/AndroidManifest.xml.Your own activity, service or receiver has an intent filter but no android:exportedFix - 2
The merging report shows the component coming from a library manifest, not from your src folder.A library's manifest declares a component without android:exportedFix
- 1
What does the error look like?
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.When using intent filters, please specify android:exported as wellINSTALL_FAILED_VERIFICATION_FAILURE (older Android Studio versions)
Cause 1 of 2
Your own activity, service or receiver has an intent filter but no android:exported
1Check
Open your manifest and look at every component that has an intent-filter child. Any of them without android:exported triggers the error.
grep -n -B3 "intent-filter" app/src/main/AndroidManifest.xml2Fix
Add android:exported. Android's guidance is true for a component with the LAUNCHER category, and false in most other cases.
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".SyncService" android:exported="false">
<intent-filter>
<action android:name="com.example.app.START_SYNC" />
</intent-filter>
</service>3Verify
Build again; the merger error should be gone.
./gradlew :app:assembleDebugConfirmed by developer.android.com
Cause 2 of 2
A library's manifest declares a component without android:exported
1Check
Open the Merged Manifest tab, click the element and read the Merging Log, or look in the report in build/outputs/logs.
grep -n "manifest-merger\|exported" app/build/outputs/logs/manifest-merger-debug-report.txt2Fix
Update the library first. If no fixed version exists, redeclare the component in your own manifest with android:exported and tools:node="merge", which merges your attribute with the library's other attributes.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<activity android:name="com.vendor.lib.SomeActivity"
android:exported="false"
tools:node="merge" />
</application>
</manifest>3Verify
Rebuild and check the Merged Manifest tab shows android:exported on the component.
./gradlew :app:assembleDebugConfirmed by developer.android.com
How do I stop it coming back?
- Set android:exported on every component the day you add an intent filter.
- Keep libraries up to date; many publish the fix as a patch release.
- Watch the lint warning 'When using intent filters, please specify android:exported as well' in the manifest editor.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Mobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile apps
Android Studio cannot pair the phone over Wi-Fi
The Pair devices over Wi-Fi dialog lists no device
Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.
4 causes, each with a fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile apps
adb tcpip 5555 fails because no device is found
adb: more than one device/emulator
adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.
4 causes, each with a fix