gpt4 book ai didi

android - 从网络下载 Artifact 时,Gradle发生了错误

转载 作者:行者123 更新时间:2023-12-03 03:49:18 30 4
gpt4 key购买 nike

我只是在android studio中设置了Flutter,但是每当我创建新项目时,运行它就会向我显示:“从网络下载 Artifact 时,Gradle抛出了错误。正在尝试下载...
异常:Gradle任务assembleDebug失败,退出代码为1“
以下是控制台日志的快照,请任何人帮助我不熟悉

Launching lib\main.dart on SM J700F in debug mode...
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.zip.ZipFile.<init>(ZipFile.java:169)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 0.6s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.zip.ZipFile.<init>(ZipFile.java:169)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 0.3s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1

最佳答案

试试这个:
请执行以下步骤:
转到flutter_app => android => gradle =>包装器目录
删除gradle-wrapper.jar文件
打开并编辑gradle-wrapper.properties文件
将distributionUrl = https://services.gradle.org/distributions/gradle-x.x.x-all.zip更改为gradle-5.6.2-all.zip或最新版本
在终端上使用flutter run命令

关于android - 从网络下载 Artifact 时,Gradle发生了错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64169796/

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