Eliminate Manifest Merge Error on Crash - Tools: Replace

The conflict in Android support versions 25.3.1 and 26.0.0-alpha1 causes a merge error when doing Gradle sync.

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

(i.e. what's the exact syntax in AndroidManifest.xml to enforce support: design: 25.3.1 instead of 26.0.0-alpha1 that the included library uses)

This Gradle error creates:

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.

      

+3


source to share


2 answers


Add "application level" to your build.gradle level, right after your 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'
}
}
}
}

      

+9


source


In the file, replace app:gradle

'com.android.support:design:25.3.1' 

      



from

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

      

0


source







All Articles