Could not resolve all dependencies for configuration ':testCompileClasspath'. Using insecure protocols with repositories, without explicit opt-in, is unsupported.

发布时间 2023-10-08 15:42:15作者: Phil-Long

Gradle init.gradle文件参数错误导致的Gradle加载失败

 

复制代码
 1 allprojects {
 2     repositories {
 3         mavenLocal()
 4         maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" } //将http改为https
 5         maven { name "Bstek" ; url "https://nexus.bsdn.org/content/groups/public/" }
 6         mavenCentral()
 7     }
 8 
 9     buildscript { 
10         repositories { 
11             maven { name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' }
12             maven { name "Bstek" ; url 'https://nexus.bsdn.org/content/groups/public/'}
13             maven { name "M2" ; url 'https://plugins.gradle.org/m2/' }
14         }
15     }
16 }
复制代码

将配置文件中的http改为https问题得到解决。