当前位置:   article > 正文

Android 配置阿里仓库_android 阿里云仓库代理配置

android 阿里云仓库代理配置

 可以在build.gradle中buildscript -> repositories 代码块添加以下代码进行配置。

  1. buildscript {
  2. repositories {
  3. maven { url 'https://maven.aliyun.com/repository/google' }
  4. maven { url 'https://maven.aliyun.com/repository/public' }
  5. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  6. google()
  7. mavenCentral()
  8. }
  9. }
  10. allprojects {
  11. repositories {
  12. maven { url 'https://maven.aliyun.com/repository/google' }
  13. maven { url 'https://maven.aliyun.com/repository/public' }
  14. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  15. google()
  16. jcenter()
  17. }
  18. }

如果在build.gradle没有找到buildscript -> repositories 代码块,可以在settings.gradle配置

  1. pluginManagement {
  2. repositories {
  3. maven { url 'https://maven.aliyun.com/repository/google' }
  4. maven { url 'https://maven.aliyun.com/repository/public' }
  5. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  6. google()
  7. mavenCentral()
  8. }
  9. }
  10. dependencyResolutionManagement {
  11. repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  12. repositories {
  13. maven { url 'https://maven.aliyun.com/repository/google' }
  14. maven { url 'https://maven.aliyun.com/repository/public' }
  15. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  16. google()
  17. jcenter()
  18. maven {
  19. url "https://jitpack.io"
  20. }
  21. }
  22. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/592890
推荐阅读
相关标签
  

闽ICP备14008679号