新装Android studio无法联网,总是报错Could not get resource 'https://jcenter.bintray.com

最近电脑重装系统了,下载了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
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章