AS Unknown host 'jcenter.bintray.com' 问题

今天重装系统后,as运行一直报 Unknown host 'jcenter.bintray.com' 错误,
百度后发现是连接不上没法下载仓库文件,可恶的墙。-_-||

解决方法:

使用阿里云仓库服务、
在根目录下build.gradle 添加 maven { url 'https://maven.aliyun.com/repository/jcenter'}
然后build 一下、就可以 了

   repositories {
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

你可能感兴趣的:(AS Unknown host 'jcenter.bintray.com' 问题)