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" }
    }
}
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容