Android导入包报错问题Failed to complete Gradle Execution Cause: error in opening zip file.
2016-03-08 18:08
387 查看
这里的话我参考了Stack overflow上的回答 先给出解释 后面给出如何解决的办法
An "error in opening zip file" tends to mean that a file that Gradle has downloaded has somehow become corrupted -- this might be the download of Gradle itself (which the wrapper does),
or a dependency that Gradle has downloaded to run your build.
Gradle doesn't attempt to detect or resolve the problem, so you need to fix it manually. The solution is often to purge Gradle's download caches and let it get fresh copies of what it
needs. To do that, delete the
in both your home directory and in your project's root directory and try building again.
错误的打开zip ,往往意味着下载工具本身出错。 好的 ,从这里我分析出可能是gradle插件出了问题 ,但是又出于某种原因(如天朝墙的原因,很多开发者往往在导入github项目的时候,因为要下载符合该项目配套的gradle插件是点了取消,但重新开启时不能更新导致的) 好的,到这里我猜测可能要手动的把gradle包给删除。
好的,我随便找了一个项目, ok 很明显发现这个gradle插件版本号为2.2.1 ,好了 那么我们就去本地目录里删除他 我们找到gradle-wrapper.properties这个文件
一般的话 ,目录位置是在这 ,好的那么我们进入2.2.1的目录 记住是-all 不是-bin
一般正常的grdle是包含4项
大小在5MB左右 , 很好 ,那么如果大小不正常的并且可能没有4项的,那我们就删除整个文件夹就ok了
到这里,我们重新打开android studio ,我们又会进入 download gradle 的界面 !如果电脑上装了360安全卫士的话,
我们可以比较下android studio 的下载速度 ,因为被墙了 ,不可能太快你懂的。估算下100kb1s秒钟,那么我们大概下载完
一个gradle 插件要5分钟左右! 好了请耐心等待吧 ,不要再乱点了!
当然也可以下载离线的gradle包,不过比较麻烦 ,这里就不做介绍啦。
An "error in opening zip file" tends to mean that a file that Gradle has downloaded has somehow become corrupted -- this might be the download of Gradle itself (which the wrapper does),
or a dependency that Gradle has downloaded to run your build.
Gradle doesn't attempt to detect or resolve the problem, so you need to fix it manually. The solution is often to purge Gradle's download caches and let it get fresh copies of what it
needs. To do that, delete the
.gradledirectories
in both your home directory and in your project's root directory and try building again.
错误的打开zip ,往往意味着下载工具本身出错。 好的 ,从这里我分析出可能是gradle插件出了问题 ,但是又出于某种原因(如天朝墙的原因,很多开发者往往在导入github项目的时候,因为要下载符合该项目配套的gradle插件是点了取消,但重新开启时不能更新导致的) 好的,到这里我猜测可能要手动的把gradle包给删除。
好的,我随便找了一个项目, ok 很明显发现这个gradle插件版本号为2.2.1 ,好了 那么我们就去本地目录里删除他 我们找到gradle-wrapper.properties这个文件
一般的话 ,目录位置是在这 ,好的那么我们进入2.2.1的目录 记住是-all 不是-bin
一般正常的grdle是包含4项
大小在5MB左右 , 很好 ,那么如果大小不正常的并且可能没有4项的,那我们就删除整个文件夹就ok了
到这里,我们重新打开android studio ,我们又会进入 download gradle 的界面 !如果电脑上装了360安全卫士的话,
我们可以比较下android studio 的下载速度 ,因为被墙了 ,不可能太快你懂的。估算下100kb1s秒钟,那么我们大概下载完
一个gradle 插件要5分钟左右! 好了请耐心等待吧 ,不要再乱点了!
当然也可以下载离线的gradle包,不过比较麻烦 ,这里就不做介绍啦。
相关文章推荐
- Android AIDL使用报错
- Android Activity 生命周期
- Android播放视频的三种方式
- android PullToRrefresh自定义下拉刷新动画
- Android ListView监听上下滑动(判断是否显示返回顶部按钮)
- Android studio 获取数字证书
- android状态栏一体化、沉浸式状态栏(兼容低版本)
- android基础学习之Fragment
- Android ActionBar 使用总结
- Android 为应用增加可移动的悬浮窗口
- android缓存数据到本地
- Android自定义View控件
- Android 判断数据库中是否存在某个表
- Android 6.0 运行时权限处理完全解析
- Android SDKManger 更新设置
- android开源框架
- Android Binder机制 (1~12)
- Android在线中文API
- 奇葩的Android Bug: Unable to start service Intent
- Android自动清理 无用 多余 未引用 未关联资源工具