Android Studio Maven仓库国内镜像

2019-10-13  本文已影响0人  缺牙青蛙

个人原创,转载请注明出处:https://www.jianshu.com/p/061d024ee6c7

在project级别的build.gradle文件加入以下代码替换google()jcenter()

buildscript {
    ...
    repositories {
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        mavenLocal()
        mavenCentral()
        //google()
        //jcenter()
    }
    ...
}

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

参考文献

https://help.aliyun.com/document_detail/102512.html?spm=a2c40.aliyun_maven_repo.0.0.36183054sd42s0#h2-u914Du7F6Eu6307u53572

上一篇下一篇

猜你喜欢

热点阅读