奇怪,我同事他们都不会出现这个问题,,,,解决也很简单,但是刚开始可能不知道
在项目的根目录gradle里面加上google()就行了,两个都要加,而且要确保google()在jcenter()上面,,,,,屡试不爽,
完整的
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}