Gradle报错 Using insecure protocols with repositories, without explicit opt-in, is unsupported.

Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven

1、原因:

gradle为了安全考虑,默认禁用使用非官方的中央仓库(比如阿里云),所以如果确认信任该仓库,需要显示声明信任它。

2、解决方法:

  • 方法1

在仓库前添加关键字:allowInsecureProtocol = true

  • 方法2

将仓库的http换成https

猜你喜欢

转载自blog.csdn.net/xiaopihair123/article/details/127530717