Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolve Manifest Merger Failed error - tools:replace

A conflict on Android Support library versions 25.3.1 and 26.0.0-alpha1 is causing a manifest merger failed error when performing a Gradle sync.

How can we use a tag with tools:replace property as Android Studio / gradle suggests to fix this error?

(i.e. what is the exact syntax within AndroidManifest.xml to force usage of support:design:25.3.1 instead of 26.0.0-alpha1 which an included library is using)

This is the error Gradle is producing:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0-alpha1) from [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38
    is also present at [com.android.support:design:25.3.1] AndroidManifest.xml:27:9-31 value=(25.3.1).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:41 to override.
like image 601
Baker Avatar asked Jul 01 '26 18:07

Baker


1 Answers

Add the following to your build.gradle "app level", just after you dependencies:

configurations.all {
resolutionStrategy.eachDependency { details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.1'
}
}
}
}
like image 174
Vincent H Guyo Avatar answered Jul 03 '26 06:07

Vincent H Guyo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!