最近電腦重裝系統了,下載了AS,新建工程卻總是沒辦法同步成功,後面把build.gradle改成如下,就可以成功了。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }
jcenter { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' }
jcenter { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}