有时候在导入项目的时候,或者在创建项目的时候会出现这样的错误:
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 (requiresnetwork)
出现这样的错误一般是gradle的版本出现了问题,我有两种解决方法:
第一种是:
看看没有报错的项目中gradle>>wrapper>>gradle-wrapper.properties中gradle的版本,修改一下就行了,但是有的时候改了还是报错。
第二种:(推荐)
1、打开File>>Settings>>Build,Execution,Deployment>>Gradle