Flutter出现Could not resolve all files for configuration ‘:app:debugCompileClasspath‘.

Flutter出现Could not resolve all files for configuration ‘:app:debugCompileClasspath’.

问题:使用Flutter在Windows11上运行安卓项目,出现报错

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform x86_64_debug-1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a.jar (io.flutter:x86_64_debug:1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Could not download x86_64_debug-1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a.jar (io.flutter:x86_64_debug:1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a)
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a/x86_64_debug-1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a.jar'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a/x86_64_debug-1.0.0-1425e5e9ec5eeb4f225c401d8db69b860e0fde9a.jar'.
               > Got socket exception during request. It might be caused by SSL misconfiguration
                  > Connection reset

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 10s

在这里插入图片描述

解决:

项目目录/android/build.gradle.kts。 不挂梯子试一遍,不行挂梯子再试一遍

allprojects {
    repositories {
        // 先从maven仓库获取
        mavenCentral()
        // maven出问题,再从阿里云获取
        maven { url = uri("https://maven.aliyun.com/repository/google") }
        maven { url = uri("https://maven.aliyun.com/repository/jcenter") }
        maven { url = uri("https://maven.aliyun.com/nexus/content/groups/public") }
        maven { url = uri("https://storage.flutter-io.cn/download.flutter.io") }
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值