切换到国内的Maven镜像仓库。
修改项目根目录下 build.gradle 文件,将 jcenter() 或者 mavenCentral() 替换掉即可。可以用国内的仓库代替:

阿里的仓库地址:http://maven.aliyun.com/nexus/content/groups/public/
OSChina的仓库地址:http://maven.oschina.net/content/groups/public/
buildscript {
    
    repositories {
    maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'}
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
    maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'}
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

相关文章:

  • 2021-12-10
  • 2021-12-22
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2021-09-30
  • 2022-12-23
猜你喜欢
  • 2021-06-22
  • 2021-09-11
  • 2022-12-23
  • 2021-08-25
  • 2021-12-26
  • 2022-01-05
  • 2021-10-20
相关资源
相似解决方案