关于Gradle7.0及以上版本报Https的错误的解决方案
Posted xiangzhihong8
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于Gradle7.0及以上版本报Https的错误的解决方案相关的知识,希望对你有一定的参考价值。
今天在升级android项目的gradle时,遇到如下的一个错误:
官方的解释是:
Specifies whether it is acceptable to communicate with a repository over an insecure HTTP connection.
For security purposes this intentionally requires a user to opt-in to using insecure protocols on case by case basis.
Gradle intentionally does not offer a global system/gradle property that allows a universal disable of this check.
*Allowing communication over insecure protocols allows for a man-in-the-middle to impersonate the intended server, and gives an attacker the ability to [serve malicious executable code onto the system.](https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer/)*
大概意思是为了安全,需要要升级成Https,修改的方式有两种。一种是将maven的http修改成为https,另一种是忽略警告,在maven中添加allowInsecureProtocol
,比如:
maven
allowInsecureProtocol = true
url 'http://developer.huawei.com/repo/'
以上是关于关于Gradle7.0及以上版本报Https的错误的解决方案的主要内容,如果未能解决你的问题,请参考以下文章
连接mysql 8以上高版本报错:Public Key Retrieval is not allowed