flutter3.0启动gradle报错

flutter3.0在启动的时候,gradle构建报错, 看起来是TLS版本不对, 但是我不知道怎么处理. 有大佬知道怎么弄吗?

错误日志:

Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom'.
            > Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.4/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

build.gradle配置的仓库地址:

buildscript {
    ext.kotlin_version = '1.6.10'
    repositories {
//        google()
//        mavenCentral()
//        maven { url 'https://maven.aliyun.com/repository/google/' }
//        maven { url 'https://maven.aliyun.com/repository/jcenter/' }
//        maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/public' }
//        maven { url "https://download.flutter.io" }
    }

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

allprojects {
    repositories {
//        google()
//        mavenCentral()
//        maven { url 'https://maven.aliyun.com/repository/google/' }//google
//        maven { url 'https://maven.aliyun.com/repository/central/' }//central
//        maven { url 'https://maven.aliyun.com/repository/public/' }//jcenter//public
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}//gradle-plugin
        maven { url "https://download.flutter.io" }
    }
}
阅读 4.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏