前言
gradle高版本会出现maven仓库地址不是https安全连接便会报错的问题;
1.报错现象
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven2(http://mvn.xxxxxx.com/content/groups/public/)' 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.
2.解决办法
maven {
allowInsecureProtocol = true
url 'http://mvn.xxxxxx.com/content/groups/public/'
}
添加属性设置: allowInsecureProtocol = true