Skip to content

Instantly share code, notes, and snippets.

@jugutier
Created January 12, 2018 22:37
Show Gist options
  • Save jugutier/4f28287bf2a1783315bd92cbd7513932 to your computer and use it in GitHub Desktop.
Save jugutier/4f28287bf2a1783315bd92cbd7513932 to your computer and use it in GitHub Desktop.
android dependency 'com.android.support:support-v4' has different version for the compile (25.2.0) and runtime (25.3.1) classpath.
/**
error: Android dependency 'com.android.support:support-v4' has different version for the compile (25.2.0) and runtime (25.3.1)
classpath. You should manually set the same version via DependencyResolution
solution: dependency rule to always resolve with a fixed version
description: this problem comes when using implementation 'com.android.support:suppport-v4:25.3.1'
because implementation forces all version of support libraries to match,
if this becomes necessary then we had to add a dependency resolution because
google play services base causes trouble even at version 11.8.0 by bringing version 25.2.0 as its dependency.
*/
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.1'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment