Tr0jAn
Tr0jAn

Reputation: 133

Android Studio throws exception while running Flutter App

When I run the flutter app it throws this error below

Launching lib\main.dart on Redmi 7 in debug mode... Running Gradle task 'assembleDebug'... 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

I have my android device connected with USB debugging on. I don't know what's wrong.

Tried Solutions :

PS: I am new to flutter any help or suggestions will be appreciated. Thank You

Upvotes: 5

Views: 6510

Answers (1)

IBRAHIM ALI MUSAH
IBRAHIM ALI MUSAH

Reputation: 979

This is mainly due to a currupt or incomplete file in the .gradle folder in your users folder. just find it and delete it and then run it again but this time around make sure you are connected to the internet to re download it again. if you are on a mac you can remove it with

cd ~
rm -rf .gradle

Upvotes: 11

Related Questions