Could not GET ‘xxx/maven-metadata.xml‘. Received status code 403 from server: Forbidden

Could not GET ‘xxx/maven-metadata.xml’. Received status code 403 from server: Forbidden

1.一般出现这种问题,首先应该排除maven仓地址问题,在根工程的build.gradle文件中增加国内的maven仓地址,比如阿里云或者其他,参考如下:

repositories {
		...
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/central' }
        maven { url 'https://maven.aliyun.com/repository/public/' }
    }

2.如果正常run可以成功,但是生成不了正式签名apk,而且执行gradle assembleRelease 查看打印,发现是

Execution failed for task ':app:lintVitalRelease'

类似如下错误:
Could not GET ‘xxx/maven-metadata.xml‘. Received status code 403 from server: Forbidden_第1张图片

解决方法就是在主项目build.gradle文件中忽略检查

android {
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

}

你可能感兴趣的:(android,android,gradle)