解决Could not find manifest-merger.jar问题

Android Studio编译的时候报如下错误

1
2
3
ERROR: Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.0).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.0/manifest-merger-26.0.0.jar

Click and drag to move

解决办法是在项目的build.gradle文件中将google()换到jcenter()前即可,如下所示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

Click and drag to move