谷谷小师妹 发表于 2023-11-4 17:52:58

Andriod 华为maven库未用https而gradle报错


Andriod 华为maven库未用https而gradle报错


报错摘要
Caused by: org.gradle.api.InvalidUserCodeException: Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven6(http://developer.huawei.com/repo/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.

build.gradle配置
maven { url "http://developer.huawei.com/repo/" }

原因
以前配置的gradle 华为maven未用https, 如今启用了https, 要求强制用的https

解决方法
把http 改为https就能下载使用华为maven库了,改了重新,启动编译,就通过了,不会报错了。

页: [1]
查看完整版本: Andriod 华为maven库未用https而gradle报错