Android Studio使用gradle下載依賴慢

22:59    Gradle sync failed: Read timed out
        Consult IDE log for more details (Help | Show Log) (30 m 42 s 951 ms)android

修改build.gradle文件以下git

buildscript {
    ext.kotlin_version = '1.2.10'
    repositories {
//        jcenter()
//        google()
//修改成阿里雲maven倉庫
        maven {
            url 'http://maven.aliyun.com/nexus/content/groups/public/'
        }
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
    }
}

allprojects {
    repositories {
//        jcenter()
//        google()
//全部項目都使用這個配置
        maven {
            url 'http://maven.aliyun.com/nexus/content/groups/public/'
        }
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
相關文章
相關標籤/搜索