简体   繁体   English

由于下载依赖项错误,导致Gradle刷新失败

[英]Gradle refresh failed due to error in downloading dependies

I upgraded android studio to v2.3 and then while trying to update the support repositories, I lost internet connection and I can't understand what to do. 我将android studio升级到v2.3,然后尝试更新支持存储库时,我失去了互联网连接,我不知道该怎么办。

I get the following error in Messages box 我在消息框中收到以下错误

Gradle 'Pets' project refresh failed
Error: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)

On one site it said to delete the file in .gradle/cache but I couldn't understand what to delete. 在一个站点上,它说要删除.gradle/cache的文件,但我不知道要删除什么。 I've tried clicking on the link to re-download dependencies but I get the same message. 我尝试单击链接以重新下载依赖项,但收到相同的消息。

Could anyone please help? 谁能帮忙吗?

Thank you! 谢谢!

I solved the problem by manually downloading the zipped file from https://services.gradle.org/distributions/gradle-3.3-all.zip and then replacing the automatically downloaded zipped file in .gradle with it. 我通过从https://services.gradle.org/distributions/gradle-3.3-all.zip手动下载压缩文件,然后用.gradle替换自动下载的压缩文件来解决了这个问题。 Then I started Android Studio and it automatically downloaded and installed the required components. 然后,我启动了Android Studio,它自动下载并安装了必需的组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM