Home > Back-end >  Exception in thread "main" java.util.zip.ZipException:
Exception in thread "main" java.util.zip.ZipException:

Time:09-21

i am having more problems with flutter, i almost completed my app and removed all the errors and wanted to run but it does not work and it shows this?

i dont know whats the problem and i am just stuck.

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)

Edit

i tried to delete the gradle from user and download it but it has its own problems as mentioned below:

Launching lib\main.dart on AOSP on IA Emulator in debug mode...

Running Gradle task 'assembleDebug'... Warning: The plugin file_picker requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. Warning: The plugin firebase_messaging requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. Warning: The plugin flutter_local_notifications requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. Warning: The plugin geolocator_android requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. Warning: The plugin webview_flutter_android requires Android SDK version 32. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. One or more plugins require a higher Android SDK version. Fix this issue by adding the following to C:\projekt\dear\android\app\build.gradle: android { compileSdkVersion 33 ... }

Checking the license for package Android SDK Build-Tools 30.0.3 in C:\Users\Nikshit\AppData\Local\Android\sdk\licenses License for package Android SDK Build-Tools 30.0.3 accepted. Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)". "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready. Installing Android SDK Build-Tools 30.0.3 in C:\Users\Nikshit\AppData\Local\Android\sdk\build-tools\30.0.3 "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete. "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished. Checking the license for package Android SDK Platform 31 in C:\Users\Nikshit\AppData\Local\Android\sdk\licenses License for package Android SDK Platform 31 accepted. Preparing "Install Android SDK Platform 31 (revision: 1)". "Install Android SDK Platform 31 (revision: 1)" ready. Installing Android SDK Platform 31 in C:\Users\Nikshit\AppData\Local\Android\sdk\platforms\android-31 "Install Android SDK Platform 31 (revision: 1)" complete. "Install Android SDK Platform 31 (revision: 1)" finished. Checking the license for package Android SDK Platform 29 in C:\Users\Nikshit\AppData\Local\Android\sdk\licenses License for package Android SDK Platform 29 accepted. Preparing "Install Android SDK Platform 29 (revision: 5)". "Install Android SDK Platform 29 (revision: 5)" ready. Installing Android SDK Platform 29 in C:\Users\Nikshit\AppData\Local\Android\sdk\platforms\android-29 "Install Android SDK Platform 29 (revision: 5)" complete. "Install Android SDK Platform 29 (revision: 5)" finished. Error: unable to locate asset entry in pubspec.yaml: "fonts/andina.ttf".

FAILURE: Build failed with an exception.

  • Where: Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 45m 44s Exception: Gradle task assembleDebug failed with exit code 1

image1

CodePudding user response:

The error is related to Gradle, this is usually due to corrupt or incomplete Gradle setup.

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.

  • Related