新裝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
}

 

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