Android build stops at processDebugManifest in a React Native app
Execution 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.
Fix it fast
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/2Match what you see, then jump to its fix
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.txt2Fix
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:processDebugManifestConfirmed by developer.android.com
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.xml2Fix
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:processDebugManifestConfirmed by developer.android.com
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:
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Mobile apps
React Native Android build cannot find the foojay-resolver-convention plugin
Plugin [id: 'org.gradle.toolchains.foojay-resolver-convention'] was not found in any of the following sources:
The foojay plugin is a settings plugin that Gradle downloads from the Plugin Portal.
3 causes, each with a fixMobile apps
Kotlin and Java compile to different JVM targets in a React Native Android build
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11)
Gradle refuses to build when the Java task and the Kotlin task target different JVM versions.
3 causes, each with a fixMobile apps
Gradle cannot run node in a React Native Android build
Process 'command 'node'' finished with non-zero exit value 1
The React Native Gradle plugin starts node for bundling.
3 causes, each with a fixMobile apps
The Android emulator opens the app but never connects to Metro or Expo
Metro bundler ECONNREFUSED 127.0.0.1:19001
When the emulator cannot reach Metro, first prove each side on its own: adb sees the emulator, and Metro listens on its port.
4 causes, each with a fixMobile apps
Axios request works on iOS or in a browser but fails on Android with Network Error
AxiosError: Network Error
A React Native app has no CORS, so on Android a Network Error usually means the request never reached the server.
3 causes, each with a fixMobile apps
Axios returns Network Error in a React Native app on iPhone or the iOS Simulator
error.code is ERR_NETWORK and error.response is undefined
A Network Error means iOS stopped the request before any HTTP answer came back.
3 causes, each with a fix