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
}





不用aliyun的maven仓库