首页 > 技术文章 > Android studio 你的主机中的软件中止了一个已建立的连接

goolinli 2021-11-09 10:32 原文

AS 软件调试时突然出现这个问题,网上搜索了一些资料,说关闭热点可以正常。

经测试发现关闭热点的后重启确实能正常。 但需要使用电脑热点,因此寻找其他解决方案。

经测试更新gradle 为7.0能解决(更改gradle/wrapper/gradle-wrapper.properties  将gradle-xx-all.zip改为gradle-7.0-all.zip),之后同步。

同步过程出现另外一个错误;Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 

发现用到的一个ali mave仓库不是https的,如果需要用http增加一行:

allowInsecureProtocol true

更改后变为:
maven {
allowInsecureProtocol true
url "http://maven.aliyun.com/nexus/content/repositories/releases"
}

同步后正常。

推荐阅读