2018.09.22 | 零零碎碎 | 3699 浏览 | 0 赞 | 0 条评论


请注意,本文编写于 2014 天前,最后修改于 1789 天前,其中某些信息可能已经过时。
AI摘要:在使用Android Studio编译项目时,遇到“Failed to open zip file”错误,可能是由于Gradle的依赖缓存损坏。解决方法是将gradle/gradle-wrapper.properties中的distributionUrl从https更改为http,即去掉一个s。这可能是因为Gradle下载的网站没有使用https。

Powered by AISummary and MoonShot Kimi Chat.

这两天在弄安卓相关,也就免不了与android-studio打交道.

在编译项目的过程中遇到了以下错误:

Error: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/gradle-wrapper.properties中的

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

改为

distributionUrl=http\://services.gradle.org/distributions/gradle-3.3-all.zip

即可(即去掉一个s)
究其原因好像是gradle下载这个网站并没有https...
不得不说国内的环境对开发者太不友好了...

本文链接:https://www.idealclover.top/archives/350/

本作品由 idealclover 采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可,转载请注明出处。

标签: network, requires, project

0

没有评论 T^T


🤔关于我
翠翠 idealclover
Product Manager @ByteDance
南京大学 2016 级本科生
了解更多
🏠关于博客
基于 Typecho 博客框架
使用个人的 clover clover 主题