美文网首页android学习
AS Unknown host 'jcenter.bintray

AS Unknown host 'jcenter.bintray

作者: 不问何处有明月 | 来源:发表于2018-09-06 11:47 被阅读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" }
        }
    }
    

    相关文章

      网友评论

        本文标题:AS Unknown host 'jcenter.bintray

        本文链接:https://www.haomeiwen.com/subject/dbztgftx.html