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.
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
Go to your Flutter project dropdown,
drop down android>gradle>wrapper
Select gradle-wrapper-properties
Paste the URL you copied earlier. For example:
distributionUrl=https://services.gradle.org/distributions/gradle-6.7-all.zip
Try to change your distributionUrl to gradle-7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With