Caused by: org.gradle.api.resources.ResourceException: Could not get resource ‘https://maven.google.

前言

在对接身份证识别

项目编译后发现:Could not resolve all artifacts for configuration ‘:classpath’;这是什么鬼,然后常规clean、rebuild、offline work、修改本地gradle…一番操作之后,依然没用。最后上google寻求帮助,成功解决了这个问题。真凶尚不明确,怀疑是网络问题,资源库加载不下来。

解决办法如下:在根目录的build文件里加上这两句镜像代码,重新编译解决

错误提示

Caused by: org.gradle.api.resources.ResourceException: Could not get resource ‘https://maven.google.

解决方法

添加阿里云镜像

 		google()
        jcenter()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }

	    google()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        maven { url "https://jitpack.io" }
        maven { url 'http://repo1.maven.org/maven2' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }

Caused by: org.gradle.api.resources.ResourceException: Could not get resource ‘https://maven.google.

上一篇:maven 配置阿里云镜像,以及本地仓库,系统环境变量配置


下一篇:linux搭建maven私服