Jenkins问题记录:android构建时提示Unzipping /home/.gradle/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/gradle-3.3-all.zip to /home/.gradle/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9 Except

--------------

 

--------------

问题:今日job构建报出如下错误:

Unzipping /home/.gradle/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/gradle-3.3-all.zip to /home/.gradle/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:219)
    at java.util.zip.ZipFile.<init>(ZipFile.java:149)
    at java.util.zip.ZipFile.<init>(ZipFile.java:163)
    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)

经查询,发现某个开发更新了gradle的版本(如下)

随即查看了路径下的gradle,发现只有16MB

登陆:http://services.gradle.org/distributions/发现,官网的gradle-3.3-all.zip有80M之多。

所以问题可能是因为网络原因导致的下载文件不完整。

 

解决方法:

1. 删除路径下的所有文件

cd /home/.gradle/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9
rm  gradle-3.3-all.zip gradle-3.3-all.zip.lck

2. 手动下载gradle-3.3-all.zip文件传到路径下或者使用wget下载。

下载完成后,再次执行构建命令,成功!

 

撒花~

 

posted @ 2018-05-18 13:12  疲惫的豆豆  阅读(1205)  评论(0编辑  收藏  举报