AndroidStudio在编译时报错:
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
在jcenter中找不到manifest-merger.jar包,看了一下我的根build.gradle文件,发现jcenter()在google()前面,它在jcenter中找不到manifest-merger.jar包就不会再去google中寻找了:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
google()
}
}
然后将google和jcenter换下位置,让它去google中下载manifest-merger.jar包,就可以编译通过了:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}