英文:
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.
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论