1. 程式人生 > >Re-download dependencies and sync project (requires network)

Re-download dependencies and sync project (requires network)

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)

一、問題描述

在使用更新版本的AndroidStuido,總會偶然性的出現各類IDE編譯的問題,尤其是gradle引起的問題,廢話不說,此處記錄遇到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)

該問題的解決方式。
這裡寫圖片描述
雖然提示什麼網路連線問題,但實質是因為Studio更新,與之相應的gradle不匹配,不論是刪除專案內的gradle,還是翻*牆也是無用,這裡吐槽一下,有問題用Google,百度,真的很垃圾!

二、解決方案

  1. 下載官方的gradle,https://gradle.org/install/
# 這裡是用choco安裝管理,提示,注意國內安全軟體的流氓攔截行為
choco install gradle
#然後配置環境變數,
  1. 修改Studio中build 配置

gradle

  1. 重新編譯即可