Gradle throws an IOException trying to extract the file

Host OS: Ubuntu Linux 13.10, linux kernel 3.13 SDK tools version: 22.3 Android Studio 0.4.3 Gradle plugin 1.10

STEPS TO REPRODUCE: 1. Start a build of a (new) project requiring the download of a package 2. For some reason the connection drops during the download, and the package is only partially downloaded (or maybe for some other reason the file is corrupted) 3. The connection is re-established

EXPECTED RESULTS: Gradle should recognize that the file is only partial (or maybe corrupted), and should download it again, or, better, restart the download from where it stopped

OBSERVED RESULTS: Gradle throws an IOException trying to extract the zip file, the build fails and there’s no way to make it work again but manually removing the partial zip file.

Thank you for the great work! Cheers

Davide Natalini

Can you reproduce this? There is a check in place to prevent such errors.

I further investigated on the error, and examining the downloaded file I found that it’s not the Gradle plugin file: it’s an html file generated by my router :frowning:

Basically, my adsl connection dropped before the download, and the router hijacked the download request and served the html file (which explains that there’s no connection).

This means that the download did happen correctly, but the file is not what was expected.

The behaviour of the router is indeed peculiar, but maybe Gradle could remove a file that cannot be unzipped and download it again, in order to prevent such a loop situation.

Thank you.


Raised as GRADLE-3008.