今天在GitHub中clone下来一项目中,用Android Studio编译时出现了“Error:Failed to open zip file. Gradle's dependency cache may be corrupt”错误。
在StackOverFlow中查找解决的方法:
在项目中的gradle->wrapper->gradle-wrapper.proerties中的
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip
改成自己项目可以用的gradle版本:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
这样还是不行的,还要在项目中的build.gradle中把依赖的版本改成能用的:
原来的:
dependencies { classpath 'com.android.tools.build:gradle:1.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }改成之后的: