Could not resolve all dependencies for configuration ‘:app:androidApis‘.

android studio出现Could not resolve all dependencies for configuration ':app:androidApis'.

试过很多种方法,但是都不好使,不管怎么样都是提示如下报错:

Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://maven.aliyun.com/nexus/content/repositories/jcenter)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.3.3/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.

这个报错我仔细读了读,发现主要是当前阿里Maven的并不是十分安全,让我换一个安全的协议或者设置安全的协议,可是我并不记得这个URL地址在哪里设置过,

直到我看到了一个帖子,这个帖子的最后我提示:可以打开https://maven.aliyun.com看最新的地址。打开这个链接之后,我大概直到错在哪里了。

看到这里我明白了,我一定是在哪里设置了一个老版的阿里云仓库地址,由于gradel默认是禁止不安全的。所以才会一直出错,我排查了根build.gradle下的maven的内容,发现也是新的仓库地址,我仔细想了想,之前由于gradel每次下载特别慢,我就按照一篇帖子说的,在.gradel下面新建了一个init.gradel文件,但是没想到这个帖子上用的是老版的仓库地址【下图以改正】:

把上面的仓库地址改成新的以后,重新加载,报错消失。

相关推荐
JMchen1233 天前
Android TCP连接实战:详解一个高效可靠的TCP客户端实现
android·java·经验分享·网络协议·tcp/ip·移动开发·android-studio
我命由我123453 天前
Android 开发问题:Duplicate class android.support.v4.app.INotificationSideChannel...
android·java·开发语言·java-ee·android studio·android-studio·android runtime
JMchen1234 天前
Android计算摄影实战:多帧合成、HDR+与夜景算法深度剖析
android·经验分享·数码相机·算法·移动开发·android-studio
( •̀∀•́ )9204 天前
GitHub Actions 安卓 APK CI 签名
android-studio
code_li5 天前
Android 16KB页面大小适配
java·架构·android-studio
、BeYourself6 天前
Intent :跳转与数据传递的正确打开方式
android·android-studio
我命由我123456 天前
Android 开发 Room 数据库升级问题:A migration from 6 to 7 was required but not found.
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
我命由我123457 天前
Android 控件 - 最简单的 Notification、Application Context 应用于 Notification
android·java·开发语言·junit·android studio·android jetpack·android-studio
JMchen1238 天前
Android CameraX深度解析:从Camera1到CameraX的相机架构演进
android·java·数码相机·架构·kotlin·移动开发·android-studio
、BeYourself9 天前
TabLayout 与 ViewPager2 的基本使用
android·android-studio