gpt4 book ai didi

android - Flutter:Gradle任务assembleDebug失败(配置根项目 'android')

转载 作者:行者123 更新时间:2023-12-03 03:56:32 25 4
gpt4 key购买 nike

我在Windows 10上使用Android Studio 3.6.1
(我是新手,这是我的第一次尝试)

您可以在这里看到我的“ flutter 打医生”结果(所有检查):
flutter doctor command result

不幸的是,当我想运行程序时,会发生此错误:
android studio error

文本:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.5.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.5.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> Connect to 127.0.0.1:2347 [/127.0.0.1] failed: Connection refused: connect
> Could not resolve com.android.tools.build:gradle:3.5.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'.
> Connect to 127.0.0.1:2347 [/127.0.0.1] failed: Connection refused: connect

* 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 20s
Finished with error: Gradle task assembleDebug failed with exit code 1

我尝试了Stack Overflow,YouTube和中型平台上的所有文章,但仍然遇到问题:

最佳答案

面对同样的问题,我解决了;

Delete all files in .gradle folder and reopen Android studio to re-download and update to the latest files.
PATH: C:\Users\<YOUR-USER-NAME>\.gradle


这为我工作。希望对您有所帮助,然后重新执行Flutter Doctor命令

关于android - Flutter:Gradle任务assembleDebug失败(配置根项目 'android'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60875966/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com