升级到gradle 4.4之后:
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Android项目编译失败,并显示以下错误:
Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.1.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.1.2/manifest-merger-26.1.2.jar
答案 0 :(得分:77)
解决方案非常简单,您必须在根 build.gradle 文件中反转jcenter()
和google()
个存储库(在我的jcenter()
中是第一个) :
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
答案 1 :(得分:9)
我通过将Gradle包装器版本升级到gradle-4.10.1-all.zip
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
答案 2 :(得分:1)
清理Gradle缓存(〜/ .gradle / caches)对我有用。
答案 3 :(得分:0)
.gradle
文件夹distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
在文件中:gradle-wrapper.properties