android学习

AS Unknown host 'jcenter.bintray

2018-09-06  本文已影响0人  不问何处有明月

今天重装系统后,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" }
    }
}
上一篇下一篇

猜你喜欢

热点阅读