Flutter Gradle 任务 assembleDebug 失败,退出代码 1 zip END 标头未找到 [英] Flutter Gradle task assembleDebug failed with exit code 1 zip END header not found

查看:33
本文介绍了Flutter Gradle 任务 assembleDebug 失败,退出代码 1 zip END 标头未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是 Flutter 的新手,我在 android studio 4.2.1 上设置了 Flutter,一切都很好.当我尝试运行它时;它告诉我以下错误我看到太多问题,但对我没有帮助扑医生运行没有发现问题她是医生的结果

Hello I am new to Flutter I have setup flutter with android studio 4.2.1, and every thing is fine. When I try to run it; it show me following error I see too much questions but it is not helpfull for me flutter doctor run no issue found Hers is doctor result

这是我的环境变量

任何人都可以指导我如何运行颤振.我正在用 chrome 吃午饭

can any one guide me how can I run the flutter. I am lunching it in a chrome

线程main"中的异常java.util.zip.ZipException:在以下位置找不到 zip END 标头java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1567) 在java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1462) 在java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1469) atjava.base/java.util.zip.ZipFile$Source.(ZipFile.java:1274) atjava.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237) 在java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:727)在java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844)在 java.base/java.util.zip.ZipFile.(ZipFile.java:247) 在java.base/java.util.zip.ZipFile.(ZipFile.java:177) 在java.base/java.util.zip.ZipFile.(ZipFile.java:191) 在org.gradle.wrapper.Install.unzip(Install.java:214) 在org.gradle.wrapper.Install.access$600(Install.java:27) 在org.gradle.wrapper.Install$1.call(Install.java:74) 在org.gradle.wrapper.Install$1.call(Install.java:48) 在org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)在 org.gradle.wrapper.Install.createDist(Install.java:48) 在org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)在org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)例外:Gradle 任务 assembleDebug 失败,退出代码为 1

exception in thread "main" java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1567) at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1462) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1469) at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1274) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:727) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844) at java.base/java.util.zip.ZipFile.(ZipFile.java:247) at java.base/java.util.zip.ZipFile.(ZipFile.java:177) at java.base/java.util.zip.ZipFile.(ZipFile.java:191) 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) Exception: Gradle task assembleDebug failed with exit code 1

推荐答案

我最近解决了这个问题.这个问题来自 gradle 文件在我的系统中已损坏.我使用的是 Linux,所以这个步骤在 Windows 中也几乎相同.

I recently Solved this problem. This Problem came from gradle file is corrupted in my system. I'm using Linux so this steps almost same in windows also.

打开文件管理器:从顶部菜单栏中启用显示隐藏文件夹.

Open File Manager : enable Show hidden folder from top menu bar.

您可能会找到此位置:.gradle\wrapper\dists.

You may find this location : .gradle\wrapper\dists.

在 Linux 中:主页 >.gradle >包装>区分

在 Windows 中:C:\Users\\.gradle\wrapper\dists

In Windows: C:\Users\<PC Name>\.gradle\wrapper\dists

有 2 个文件夹.

  1. gradle-6.7.1-bin
  2. gradle-6.7-all

点击gradle-6.7.1-bin >'gradle-6.7.1-bin.zip' 并尝试打开,如果已打开该 zip 文件并且存在一些文件,则该文件没问题.

Click on gradle-6.7.1-bin > 'gradle-6.7.1-bin.zip' and try to open if opened that zip file and there some files are present then that file is fine.

点击gradle-6.7-all >gradle-6.7-all.zip 如果已打开该 zip 文件并且存在文件,则尝试打开该文件.

Cl onick gradle-6.7-all > gradle-6.7-all.zip try to open if opened that zip file and there files are present then that file is fine.

如果未打开,则该文件已损坏.

If not opened, that file is corrupted.

大多数情况下 gradle-6.7-all.zip 文件会损坏.所以需要手动下载:https://downloads.gradle-dn.com/distributions/gradle-6.7-all.zip

Most of time gradle-6.7-all.zip file will be corrupted. So you need to download it manually: https://downloads.gradle-dn.com/distributions/gradle-6.7-all.zip

并删除损坏的 zip 文件并粘贴新下载的 zip 文件.并确保下载的文件是否打开.

and delete that corrupted zip file and paste freshly downloaded zip file. And make sure downloaded file is opening or not.

Flutter Doctor 会给出正确的结果.

Flutter Doctor will give right result.

  1. 打开 Android Studio
  2. 创建新的颤振项目
  3. 点击工具>Flutter >Flutter 用于在 android studio 中进行编辑

等等,Flutter Doctor 需要时间来发现问题.

and wait, flutter doctor takes time to identify problem.

希望这个回答对你有帮助.

I hope this answer helpful for you.

这篇关于Flutter Gradle 任务 assembleDebug 失败,退出代码 1 zip END 标头未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆