Manifest merger failed


#1

I believe the build.gradle needs some change, if I add RecyclerView library dependency then build, I have:

Error:Execution failed for task ‘:app:processDebugManifest’.

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:recyclerview-v7:26.0.0-alpha1] AndroidManifest.xml:24:9-38 value=(26.0.0-alpha1).
Suggestion: add ‘tools:replace=“android:value”’ to element at AndroidManifest.xml:25:5-27:34 to override.

What I did is in build.gradle (Module: app), add this stanza:

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == ‘com.android.support’) {
if (!requested.name.startsWith(“multidex”)) {
details.useVersion ‘25.3.0’
}
}
}
}

Has any of you had the same issue?


#2

did you ever figure this out - I am getting same thing - thanks


#3

Hello,

Probably, VERSION of Android you use doesn’t support recyclerview.
This is because, your recyclerview is 26.0.0-alpha1 but
your appcompat is -v7:25.3.1
I suggest you change it as I wrote to below:

compile 'com.android.support:appcompat-v7:26.0.0-alpha1' 
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'

then,
you should change in your gradle,

targetSdkVersion 26
compileSdkVersion 26

if they don’t change.

1


#4

Yes, I have.

It is recommended to use the same library versions for all your dependencies. Otherwise, you may see such similar error messages when gradle is attempting to make a build. Nevertheless, I use a manual approach. I get the list of all the different support library version used by my dependencies and enforce one version for all by typing out the conflicting library with the global version.

I see that you have enforced this programmatically. Did this work for you? If so, I’ll also adapt to this, saves me a lot of trouble. Thanks! :sunny: