美文网首页
AS - Failed to open zip file. Gr

AS - Failed to open zip file. Gr

作者: Jiun俊 | 来源:发表于2017-12-13 14:52 被阅读0次

异常信息:

Failed to open zip file.

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)

Re-download dependencies and sync project (requires network)

具体描述:

    之前项目的 Gradle 都是在线更新,升级到 AndroidStudio 3.0+ 后不能在线更新下载了。提示连接不到网络。。。Gradle 官网在国内轻松打开啊,难道没用官网的链接下载。

解决方案:

1. 手动去官网下载相应的 Gradle 版本,比如 :http://services.gradle.org/distributions/ 下载最新的 gradle-4.4-bin.zip。

2. 下载完成后,将 zip 包解压到 AndroidStudio 安装目录的 gradle 文件夹下。

3. 打开 AndroidStudio 打开 File -> Settings -> Gradle -> Build, Exectution, Deployment -> Gradle and set "Gradle home" 指向上面的解压目录。

我实际使用的是4.1版本

4. Sync 一下项目,就可以使用了。

相关文章

网友评论

      本文标题:AS - Failed to open zip file. Gr

      本文链接:https://www.haomeiwen.com/subject/bzgaixtx.html