我升级Flutter到最新版本后出现了这个错误。

huangapple go评论62阅读模式
英文:

I get this error i get after upgrading flutter to the latest version

问题

在升级 Flutter 后,我遇到了这个错误。请问我该如何修复它?

启动 lib\main.dart 在 Android SDK 上,以调试模式构建的 x86... 主线程中的异常 "main" java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1607) at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1497) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1504) at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1308) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1271) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:733) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850) at java.base/java.util.zip.ZipFile.(ZipFile.java:248) 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) 异常: Gradle 任务 assembleDebug 退出代码为 1 退出 (sigterm)

英文:

I get this error after upgrading flutter. please how can i fix it.

Launching lib\main.dart on Android SDK built for x86 in debug mode... Exception in thread "main" java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1607) at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1497) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1504) at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1308) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1271) at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:733) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:248) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:177) at java.base/java.util.zip.ZipFile.<init>(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 Exited (sigterm)

答案1

得分: 0

如果你正在使用Windows,请前往根目录C:\Users\YourUser,找到隐藏的.gradle文件夹并将其删除。
然后运行你的应用程序连接到Android模拟器或设备,不要取消并确保有稳定的互联网连接,这将下载新的Gradle。

如果问题仍然存在,能否提供你的flutter doctor -v和flutter run --verbose日志,以及一个最小的完整可复制的代码示例?

英文:

if you're using Windows, Go to the root directory C:\Users\YourUser and locate the hidden .gradle folder and delete it.
and then run your app connected to an Android emulator or device, don't cancel and make have a stable internet connection, this will download fresh Gradle

If the problem persists, Can you please provide your flutter doctor -v and flutter run --verbose logs, and a minimal complete reproducible code sample

huangapple
  • 本文由 发表于 2023年2月14日 06:22:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/75441753.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定