电脑重装后,重新安装了Android studio,没想到创建第一个项目就出了错,报错如下:
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:appcompat-v7:26.1.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-vector-drawable:26.1.0] AndroidManifest.xml:25:13-31 value=(21).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
自己尝试修改解决,以失败告终。。。真是让人脑壳疼。。。于是上网查找解决方法,尝试了几种方式,只有一种方法有效:
解决方法如下:
修改app路径下的build.gradle,在最后面添加如下代码:
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'
}
}
}
}