Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Launching lib\main.dart on V2166BA in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:7.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:7.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
> Could not resolve com.android.tools.build:gradle:7.3.0.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
> Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
* 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 17s
Retrying Gradle Build: #1, wait time: 100ms
[!] Gradle threw an error while downloading artifacts from the network.
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:7.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:7.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
> Could not resolve com.android.tools.build:gradle:7.3.0.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
> Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.7.10/kotlin-gradle-plugin-1.7.10.pom'.
> Connect to 127.0.0.1:9910 [/127.0.0.1] failed: Connection refused: no further information
* 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 8s
[!] Gradle threw an error while downloading artifacts from the network.
Exception: Gradle task assembleDebug failed with exit code 1
新建的flutter,运行项目就报错
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
关注【相关推荐】
- 这有个类似的问题, 你可以参考下: https://ask.csdn.net/questions/7489038
- 这篇博客也不错, 你可以看下第一次运行flutter项目遇到的的坑
- 您还可以看一下 亢少军老师的flutter高仿微信项目实战课程中的 消息模块实现小节, 巩固相关知识点
- 除此之外, 这篇博客: flutter(二)开发工具的介绍和安装,运行项目中的 5.升级flutter 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
我们在开发flutter中 肯定需要升级,因为flutter的版本更新也很快,下面提供两种升级方式:
- 使用终端中flutter upgrade,进入安装目录执行或者直接执行(配置过环境变量)

- 删除sdk包重新下载,重新配置环境变量
- 使用终端中flutter upgrade,进入安装目录执行或者直接执行(配置过环境变量)
如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^解决评论 打赏 举报无用 1