Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The message “Manifest merger failed with multiple errors, see logs” is only a build summary—it does not identify the conflict. Read the detailed merger errors, then use Android Studio’s Merged Manifest view to find the conflicting element or attribute and the manifest that supplied it. Fix the declaration that conflicts with your app’s intended behavior, and inspect the merged result before rebuilding.

What the manifest merger does

An Android project can have several manifest files: one for the app, others for build variants or source sets, and more from imported libraries. During a build, Gradle combines those inputs into the single AndroidManifest.xml packaged with the app. The generic failure message means the merge could not be completed cleanly; it does not say which declaration caused the problem. Android’s manifest-merging documentation explains the inputs and how to inspect the result.

Find the specific conflict

  1. Expand the build output. In Android Studio’s Build window, expand the failed build task and read the detailed manifest-merger errors rather than stopping at the summary line. The detailed output may name the element or attribute and explain the conflict.
  2. Open the merged view. Open the app module’s manifest in Android Studio and select the Merged Manifest view. Locate the element or attribute named in the error and inspect which input manifests contributed it.
  3. Check the variant being built. Identify the active build variant and its source sets, as well as the app module’s main manifest and any library manifests involved. A different variant can contribute a different declaration.

Use the error and merged view together: the error describes what failed, while the merged view helps trace the declarations to their sources.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand which manifest takes priority

Merge priority affects which declaration wins when inputs differ. Variant manifests have higher priority than the app’s main manifest, and the app’s main manifest has higher priority than imported library manifests. If multiple libraries declare the same item, their order follows the project’s dependencies block. Android documents the merge priorities and rules.

Before changing a declaration, ask:

  • Which source set, variant, or library contributed it?
  • Is the value appropriate for the app’s intended behavior?
  • Does the active variant change which declaration has priority?
  • Is the value actually controlled by Gradle build configuration rather than the manifest?

Choose a narrow fix

Once you know which declarations conflict, change the app or dependency declaration that is wrong for the intended behavior. If the higher-priority manifest should deliberately control how a lower-priority declaration is merged, use the appropriate tools merge marker. Markers can apply to an element or selected attributes; for example, a node marker can remove or replace an element.

To use a marker, declare the tools namespace on the root <manifest> element:

xmlns:tools="http://schemas.android.com/tools"

Do not add a marker just to silence the error. A merge rule changes the packaged manifest, so first confirm that the resulting declaration preserves the behavior your app needs. After making the change, return to Merged Manifest and verify the result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check Gradle configuration and plugin compatibility when relevant

Some values in the manifest can be overridden by build configuration. If the error concerns minSdk or a similar setting, inspect the relevant Gradle configuration as well as the manifest; changing only the manifest may not change the effective value. The Android documentation describes these build-configuration overrides.

An unsupported manifest element can also point to an Android Gradle Plugin compatibility issue. Check the plugin version and the requirements for the specific feature named in the error. For example, an Android Developers Blog post from 2020 says Android Gradle Plugin 4.1 or later supports the <queries> declaration in the context of Android 11 package visibility. That historical example is relevant only when the error concerns that feature; it does not mean every manifest merge failure needs a plugin upgrade. Read the Android 11 package-visibility guidance.

Verify the repair

  1. Rebuild the same variant that produced the error.
  2. Read the detailed output again if the merge still fails; a corrected conflict may reveal another distinct one.
  3. Inspect Merged Manifest to confirm that the final element and attributes match the intended app behavior.
  4. If the result is unexpected, trace the contributing manifests and recheck the active variant, dependency declarations, and relevant Gradle settings before adding more merge markers.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.