安卓报错Switch Maven repository ‘maven‘....解决办法

打开Android studio 项目代码没有修改过,之前也是完好运行的,现在突然报错,项目不能运行,重启也没生效

报错信息
在这里插入图片描述
翻译报错说明

在这里插入图片描述
解决办法
在库链接上方添加配置代码:allowInsecureProtocol = true
在这里插入图片描述

参考的原文地址(内容更丰富),而我这篇只是简单的说明一下解决办法,原文里更详细和各种情况解决。

https://blog.csdn.net/u011426115/article/details/119741756

如果上面的地址没解决,再看下这个地址。下面这个地址对于我的项目没有解决

https://blog.csdn.net/MoonAndroid/article/details/125219996

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(XXX)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. 该错误表示在使用Maven仓库时,使用不安全的协议(如HTTP)而没有明确的授权是不被支持的。解决方法有两种: 1. 在项目的build.gradle文件中添加关键字allowInsecureProtocol,并设置为true,例如: maven { allowInsecureProtocol = true url 'xxx' } 2. 将Maven仓库的地址URL从HTTP改为HTTPS,例如: maven { allowInsecureProtocol true url 'https://maven.aliyun.com/nexus/content/groups/public/' } 要解决这个问题,您可以根据上述方法之一进行操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven...](https://blog.csdn.net/qq_22255311/article/details/122600752)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [解决Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch ...](https://blog.csdn.net/wanghonghongkx/article/details/128611987)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值