今天第一次搞gradle,突然就报错了,打印出A problem occurred configuring root project 'My Application'.并且含有补充是:
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'Bstek(http://nexus.bsdn.org/content/groups/public/)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/8.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
翻译:
不支持在没有明确选择的情况下使用不安全协议的版本库。将Maven资源库'Bstek(http://nexus.bsdn.org/content/groups/public/)'重定向到安全协议(如HTTPS)或允许不安全的协议。详见https://docs.gradle.org/8.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol。
即使翻译了,我开始也看不懂,到处找网上教程,但都是改环境变量。
马虎的我即使看了很多遍,改了很多遍也没反应过来,Bstek这个远程仓库http要加s。
allprojects {
repositories {
mavenLocal()
maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" }
maven { name "Bstek" ; url "https://nexus.bsdn.org/content/groups/public/" }
mavenCentral()
}buildscript {
repositories {
maven { name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' }
maven { name "Bstek" ; url 'https://nexus.bsdn.org/content/groups/public/' }
maven { name "M2" ; url 'https://plugins.gradle.org/m2/' }
}
}
}
上面修改配置在在gradle中的init.d文件夹下init.gradle文件。
好了我就继续看项目了