Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: Exception in thread "main" java.util.zip.ZipException: error in opening zip file

I created a new flutter project in android studio 3.5, but facing error

Exception in thread "main" java.util.zip.ZipException: error in opening zip file

Efforts for the solution: this, this but did not work for me.

like image 456
Sanket Vekariya Avatar asked Mar 28 '20 08:03

Sanket Vekariya


3 Answers

  1. Browse to the official Gradle Distributions webpage and check what is the latest version of gradle all.zip file, for example (at the time of writing) gradle-6.7-all.zip and copy the address

  2. Go to your Flutter project dropdown,

    drop down android>gradle>wrapper

  3. Select gradle-wrapper-properties

  4. Paste the URL you copied earlier. For example:

    distributionUrl=https://services.gradle.org/distributions/gradle-6.7-all.zip
    
like image 69
aamirsuhxil Avatar answered Oct 07 '22 01:10

aamirsuhxil


Try to change your distributionUrl to gradle-7.1-all.zip

distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip

enter image description here

like image 41
Umer Waqas CEO Fluttydev Avatar answered Oct 07 '22 01:10

Umer Waqas CEO Fluttydev


After hours of effort, I came up with the solution.
I have changed gradle wrapper properties distribution url version to: 5.5.1-all which was available in my system.
Due to some reason, android studio was fetching the latest version which was not in my system.

like image 23
Sanket Vekariya Avatar answered Oct 07 '22 00:10

Sanket Vekariya