Baker
Baker

Reputation: 28010

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.

Upvotes: 3

Views: 2592

Answers (2)

starringharsh
starringharsh

Reputation: 1

In your app:gradle file, replace

'com.android.support:design:25.3.1' 

with

'com.android.support:design:26.+'

Upvotes: 0

Vincent H Guyo
Vincent H Guyo

Reputation: 395

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'
}
}
}
}

Upvotes: 9

Related Questions