当前位置:   article > 正文

AndroidStudio gradle配置新版阿里云maven镜像,解决​java.net.UnknownHostException: dl.google.com ​问题_failed to download any source lists! io exception

failed to download any source lists! io exception while downloading manifest

由于老项目之前也配置过阿里云镜像,最近发现依赖下得特别慢甚至下载失败报错:

Failed to download any source lists! IO exception while downloading manifest: java.net.UnknownHostException: dl.google.com

发现现在新的阿里云maven变了,更换为最新的阿里云镜像则解决, 记录一下:

  1. //新版阿里云镜像
  2. maven {url 'https://maven.aliyun.com/repository/public/'}
  3. maven {url 'https://maven.aliyun.com/repository/google/'}
  4. maven {url 'https://maven.aliyun.com/repository/central/'}
  5. maven {url 'https://maven.aliyun.com/repository/gradle-plugin/'}
  6. mavenLocal()
  7. mavenCentral()
  8. //老版的阿里云镜像
  9. //maven {url 'https://maven.aliyun.com/nexus/content/groups/public'}
  10. //maven {url 'https://maven.aliyun.com/nexus/content/repositories/central'}
  11. //maven {url 'https://maven.aliyun.com/nexus/content/repositories/google'}
  12. // maven {url 'https://maven.aliyun.com/nexus/content/repositories/google'}

附上完整的gradle

  1. buildscript {
  2. ext.kotlin_version = "1.5.10"
  3. repositories {
  4. maven {url 'https://maven.aliyun.com/repository/public/'}
  5. maven {url 'https://maven.aliyun.com/repository/google/'}
  6. maven {url 'https://maven.aliyun.com/repository/central/'}
  7. maven {url 'https://maven.aliyun.com/repository/gradle-plugin/'}
  8. mavenLocal()
  9. mavenCentral()
  10. }
  11. dependencies {
  12. classpath "com.android.tools.build:gradle:4.2.2"
  13. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  14. // NOTE: Do not place your application dependencies here; they belong
  15. // in the individual module build.gradle files
  16. }
  17. }
  18. allprojects {
  19. repositories {
  20. maven {url 'https://maven.aliyun.com/repository/public/'}
  21. maven {url 'https://maven.aliyun.com/repository/google/'}
  22. maven {url 'https://maven.aliyun.com/repository/central/'}
  23. maven {url 'https://maven.aliyun.com/repository/gradle-plugin/'}
  24. mavenLocal()
  25. mavenCentral()
  26. }
  27. }
  28. task clean(type: Delete) {
  29. delete rootProject.buildDir
  30. }

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

闽ICP备14008679号