源文来自:https://blog.youkuaiyun.com/taoerchun/article/details/86004456
新建的android项目,出现 “Failed to resolve: com.android.support:appcompat-v7:27+” 的错误, 点击 Try Again 无效。
经百度,得知需要修改 build.gradle文件,allprojects -> repositories 中增加节点 maven,如下:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven{
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}