does resolutionStrategy affect the dependent lib

Having a project which itself is using supportLib version 0f 27.1.1.

It has dependencies on a few libs, not sure from which one causes this error:

Execution failed for task ':demo:processDebugManifest'. Manifest merger failed : Attribute value=(26.0.2) from [] AndroidManifest.xml:25:13-35 is also present at [] AndroidManifest.xml:25:13-35 value=(26.1.0). Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:23:9-25:38 to override.

after added this resolutionStrategy:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if ( == '') {
            if (!"multidex")) {
                details.useVersion "${}"  //<== is 27.1.1

the error goes away.

I guess it says this project should be using 27.1.1 regardless if there is dependencies who may use different one.

Question is will this also force the dependent libs to use 27.1.1, which may not be work against this version of 27.1.1?

or it only affects this project itself?

1 answer

  • answered 2018-07-11 21:37 Martin Zeitler

    it changes the version numbers for requested group and there are no "different versions" of version 27.1.1. one can also define the version numbers in the Manifest.xml <application> tag, with tools:replace: