Mike Mike - 9 months ago 132
Java Question

Force to downgrade API from 26.1 to 25.4

I started a project with API 26. After some time I decided that I want to go with API 25, thus I replaced

compileSdkVersion
,
targetSdkVersion
and
minSdkVersion
26->25. However, I keep getting error upon gradle sync/build saying:


Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#[email protected] value=(25.4.0) from [com.android.support:design:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-core-utils:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:26:9-28:38 to override.


At first I saw that some "External Libraries" (such as core-utils) still point to 26.1.0 so I tried to force using 25.4.0 in build.gradle file but it still links 26.1 as you can see on the screenshot below. What should I do to force downgrade to 25.4.0?

enter image description here

Answer Source

When i encounter similar issues I perform two actions to pin point the problem;

  1. Use ./gradlew dependencies to map out what is being transitively resolved to the unexpected support library version.
  2. And armed with this information head on over to the module (looks like you only have 1 gradle module in your project) and then within that module's build.gradle explicitly define a resolutionStrategy such as;

Snippet;

configurations.all {
    resolutionStrategy.force "com.android.support:support-core-utils:{version}"
}

Hope that helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download