Skip to content

Android build errorAndroid: “Manifest merger failed”

The Android build stops with Manifest merger failed. Gradle merges your AndroidManifest.xml with the manifests of every library and build variant into one file, and two of them disagree. The most common case since Android 12 is a component with an intent filter but no android:exported value; the others are two manifests setting the same attribute differently, or a library that needs a higher minSdk.

Short answer

Read the full error or open the Merged Manifest tab in Android Studio: it names the element and the conflicting files. If it mentions android:exported, add android:exported="true" to the launcher activity and "false" to other components with intent filters unless another app must start them (a share target or deep link), and update any library whose manifest lacks it. For an attribute clash, keep your value with tools:replace. For a minSdk clash, raise your minSdk or, if you are sure, use tools:overrideLibrary.

Why the manifests don’t merge, and the fix

  1. 01

    android:exported is missing (Android 12 and higher)

    “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.” Android Developers, Behavior changes: Apps targeting Android 12

    When an app targets Android 12 or higher, every activity, service or broadcast receiver with an intent filter must say whether other apps can start it. Flutter and React Native apps often hit this after raising targetSdk. Set it in your own manifest, and update plugins whose manifests are missing it.

    <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>
  2. 02

    Which value to use

    “If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false.” Android Developers, Behavior changes: Apps targeting Android 12

    The activity that opens from the home screen needs true. Most other components should be false unless another app is meant to start them, such as a share target or a deep link handler.

  3. 03

    Two manifests set the same attribute differently

    “If any conflicts occur, they appear under Merging Errors with a recommendation for how to resolve the conflict using merge rule markers.” Android Developers, Manage manifest files

    A library may set android:label, android:theme, android:allowBackup or another attribute to a different value than your app. Open the Merged Manifest tab to see the clash, then mark the attribute in your manifest with tools:replace so your value wins.

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools">
        <application
            android:allowBackup="false"
            tools:replace="android:allowBackup">
            <!-- your activities -->
        </application>
    </manifest>
  4. 04

    A library needs a higher minSdk

    “By default, when importing a library with a minSdk value that's higher than the main manifest file, an error occurs and the library cannot be imported.” Android Developers, Manage manifest files

    If a library declares a higher minSdk than your app, the merge fails, naming both versions. The safe fix is to raise minSdk in the app module’s build.gradle to match. tools:overrideLibrary on the uses-sdk tag skips the check, but the library may then crash on older devices, so only use it when you know the code path is guarded.

    // app/build.gradle: the usual fix
    android {
        defaultConfig {
            minSdk 23 // match the version named in the error
        }
    }
    
    <!-- last resort, in AndroidManifest.xml -->
    <uses-sdk tools:overrideLibrary="com.example.lib" />

Checked against the vendor’s docs on : Android Developers: Manage manifest files (merging, conflicts, tools:replace); Android Developers: Behavior changes for apps targeting Android 12 (android:exported).

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Flutter Gradle task assembleDebug failed · Google Play target API level requirement · Android cleartext HTTP blocked

Questions

More on this error

Where is the full error?

Android Studio lists conflicts under Merging Errors in the Merged Manifest tab, and Gradle writes a full report to build/outputs/logs/manifest-merger-<variant>-report.txt in the app module.

The missing android:exported is in a plugin. What do I do?

Update the plugin first, and check its changelog or issues for an android:exported fix. If there is none, declare the same component, with the same android:name, in your app manifest with android:exported set. Your app manifest has the higher priority, so your value is used where the plugin sets none, and the plugin’s intent filters still merge in.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.