pwjcw 2022-12-25 18:39 采纳率: 66.7%
浏览 37
已结题

Android studio flutter构建项目时Gradle报错

Android studio flutter构建项目时Gradle报错

Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven3(http://maven.aliyun.com/nexus/content/groups/public)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols.

img

按照网上的说法:在仓库前添加关键字:allowInsecureProtocol=true和使用https链接,均无效

我的android/build.gradle内容如下


```yaml
buildscript {
    ext.kotlin_version = '1.7.20'
    repositories {
//        google()
//        mavenCentral()
//        mavenCentral()
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/google' }
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/google-plugin' }
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/public' }
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/jcenter' }

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
//        google()
//        mavenCentral()
//        mavenCentral()
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/google' }
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/google-plugin' }
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/public' }
        maven{
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/repository/jcenter' }

    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}





  • 写回答

2条回答 默认 最新

  • 全栈CV工程师 2022-12-28 16:15
    关注

    不用aliyun的maven仓库

    本回答被专家选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 1月8日
  • 专家已采纳回答 12月31日
  • 创建了问题 12月25日

悬赏问题

  • ¥15 c++2013读写oracle
  • ¥15 c++ gmssl sm2验签demo
  • ¥15 关于模的完全剩余系(关键词-数学方法)
  • ¥15 有没有人懂这个博图程序怎么写,还要跟SFB连接,真的不会,求帮助
  • ¥30 模拟电路 logisim
  • ¥15 PVE8.2.7无法成功使用a5000的vGPU,什么原因
  • ¥15 is not in the mmseg::model registry。报错,模型注册表找不到自定义模块。
  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音