【问题标题】:Using insecure protocols with repositories, without explicit opt-in对存储库使用不安全协议,无需明确选择加入
【发布时间】:2021-11-17 12:35:58
【问题描述】:

我最近将我的工作室更新为北极狐,但我的项目出现错误

Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Using insecure protocols with repositories, without explicit opt-in, 
is unsupported. Switch Maven repository 'maven3(http://dl.bintray.com/mobisystech/maven)' to redirect to a 
secure protocol (like HTTPS) or allow insecure protocols. 
See https://docs.gradle.org/7.0.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.

【问题讨论】:

    标签: android android-studio build.gradle


    【解决方案1】:

    检查您的存储库。理想情况下,它们应该指向 https 域。

    示例。

    repositories {
        maven {
            url "https://jitpack.io"
        }
    }
    

    如果url只存在于http协议下,可以添加allowInsecureProtocol属性。看下面的例子

    repositories {
        maven {
            url "http://oss.sonatype.org/content/repositories/snapshots"
            allowInsecureProtocol = true //add this line
        }
    }
    

    【讨论】:

    • 不起作用。我也试过“setAllowInsecureProtocol(true)”。 Gradle 7 不使用我们公司的内部存储库构建。 ://
    • 任何解决方案。我也面临与第 7 版相同的情况
    • 通过在我的 (Windows) C:\Users\\.gradle\init.gradle 文件中为 Gradle-v7 添加allowInsecureProtocol = true 解决了我的问题
    猜你喜欢
    • 2021-12-25
    • 2021-11-06
    • 1970-01-01
    • 2021-10-29
    • 2013-07-02
    • 1970-01-01
    • 1970-01-01
    • 2014-05-04
    • 2023-03-22
    相关资源
    最近更新 更多