Error:Execution failed for task ‘:app:processDebugManifest’.
Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.1.0) from [com.android.support:cardview-v7:26.1.0] AndroidManifest.xml:25:13-35
is also present at [com.android.support:support-v4:26.0.2] AndroidManifest.xml:28:13-35 value=(26.0.2).
Suggestion: add ‘tools:replace=”android:value”’ to element at AndroidManifest.xml:23:9-25:38 to override.
解决方案:
在app的build.gradle中添加–>
//这段代码的意思是强制改变所有引用com.android.support 版本为25.3.0。
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'
}
}
}
}