I am trying to unzip an archive file in my Gradle build script.
The archive file exists, and I have checked that it is indeed a zip file by running
file myfile.zip
However, build fails with the following error:
Could not expand ZIP '/.../file.zip': is not a ZIP archive
For Windows: Please delete the package of the zip file and clean gradle. It will resolve.
One reason this can happen is if the file is damaged or corrupted.
The way to check that is to try manually unzipping the file.
For me, the problem was semi-unrelated. My build directory was owned by root and I was running as a user that did not have permissions to write there. I ended up deleting the dir and the next gradle build handled it.
Yes.. it was due to permission on that file.
For windows:
If still not work, delete the zip file and let them create again after 1st step. It will resolve.
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