Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android build stops at processDebugManifest in a React Native app

ErrorExecution failed for task ':app:processDebugManifest'

Short answer

processDebugManifest is the step that merges your AndroidManifest.xml with the manifests of every library. It fails when two files give the same attribute different values, or when a library asks for a higher minSdk than your app. Read the merge report first: it names the file and the attribute, and the fix is a tools marker or a matching minSdk.

  • Applies to Android Gradle Plugin 8.x, React Native 0.7x, Gradle 8.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Run the build again from the android folder with the full stack trace. The merger prints the conflicting attribute and the manifest files it came from, and it also writes a report you can open.

    cd android
    ./gradlew :app:processDebugManifest --stacktrace
    ls app/build/outputs/logs/
  2. 2Match what you see, then jump to its fix

    1. 1The error names an attribute (for example android:allowBackup or android:theme) and two manifest files that disagreeTwo manifests set the same attribute to different valuesFix
    2. 2The error says a library's uses-sdk minSdkVersion is higher than the app'sA library needs a higher minSdk than your appFix

What does the error look like?

  • Execution failed for task ':app:processDebugManifest'
  • Manifest merger failed

Cause 1 of 2

Two manifests set the same attribute to different values

1Check

The merger compares each element from a library manifest with the matching element in yours. If both declare the same attribute with different values, that is a conflict and the build fails until you say which value wins. Open the manifest-merger report in app/build/outputs/logs/ to see which library set it.

ls app/build/outputs/logs/
grep -n "ERROR" app/build/outputs/logs/manifest-merger-*-report.txt

2Fix

In your own app manifest, declare the tools namespace and add tools:replace for the attribute, so your value wins. Use tools:remove to drop an attribute, or tools:node="remove" to drop a whole element that a library adds.

<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">
    </application>
</manifest>

3Verify

Rebuild the debug variant; the merge step should pass.

./gradlew :app:processDebugManifest

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 2

A library needs a higher minSdk than your app

1Check

When a library manifest has a higher minSdk than the one in your Gradle config, the merger raises an error. Compare the two values.

grep -n "minSdk" app/build.gradle build.gradle gradle.properties
grep -n "minSdkVersion" ../node_modules/<library>/android/src/main/AndroidManifest.xml

2Fix

The clean fix is to raise your own minSdk to the library's value. If you really must keep the lower value, add tools:overrideLibrary for that library's package in your manifest, and make sure the library never runs on the older devices.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-sdk tools:overrideLibrary="com.example.lib1" />
</manifest>

3Verify

Rebuild; the minSdk error should be gone.

./gradlew :app:processDebugManifest

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Put minSdk, targetSdk and compileSdk only in the Gradle config, and leave the uses-sdk element out of the manifest, as the Android docs advise.
  • After adding a native library, run one debug build before you continue, so a merge conflict points at that library.
  • Check the merged manifest view in Android Studio (the Merged Manifest tab) when the report is long.

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

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.