新建的Android - Flutter项目,运行直接报错:
Exception in thread "main" java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1573)
at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1468)
at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1475)
at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1280)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1243)
at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:732)
at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:841)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:247)
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
出错原因:对应的gradle没有找到。
解决:更换gradle版本,我是将6.7更改为了6.9?
?即:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
|