在从ECLIPSE导入工程到Studio中时, 在页面下方的Messages Gradle Build对话框里, 报错如下:
Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a>
<a href="syncProject">Re-download dependencies and sync project (requires network)</a> ?
这是由于gradle的版本不一致导致的. 解决方法如下:
1, 在Moudle下的build.gradle里, 修改dependencies 里的版本号为1.0.0即可.
2, 在项目中的gradle - wrapper - gradle-wrapper.properties文件中, 修改版本号为2.2.1即可.
然后再点击页面右上方的sync now (也可能是try Again). 等一下下, 然后同步完成后, 错误即可消失.
此时如果再出现其它问题, 再寻找相关解决办法即可.
有问题欢迎留言讨论.