
当我打开Project时会出错:
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)
我试过这个:
Error:Failed to open zip file. Gradle dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
但不适合我.
这是我的build.gradle文件:
apply plugin: 'com.androID.application'androID { compileSdkVersion 26 buildToolsversion "26.0.2" defaultConfig { applicationID "com.example.web" minSdkVersion 18 targetSdkVersion 26 versionCode 1 versionname "1.0" } buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'),'proguard-rules.pro' } } productFlavors { }}dependencIEs { compile filetree(dir: 'libs',include: ['*.jar']) compile 'com.androID.support:appcompat-v7:26.0.1' compile 'com.androID.support.constraint:constraint-layout:1.0.2'}allprojects {repositorIEs { jcenter() maven { url 'https://maven.Google.com' } maven { url "https://jitpack.io" }}顶级构建文件(项目级别)
// top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositorIEs { jcenter() } dependencIEs { classpath 'com.androID.tools.build:gradle:2.3.3' // NOTE: Do not place your application dependencIEs here; they belong // in the indivIDual module build.gradle files }}allprojects { repositorIEs { jcenter() flatDir { dirs "${rootDir}/libs" } }}task clean(type: Delete) { delete rootProject.buildDir}最佳答案前段时间我也面临同样的问题,我找到了简单的解决方法.file ->InvalIDate Caches/ Restart -> Select InvalIDate and Restart option.它将清除所有本地历史记录并自动重启.将自动下载所有必需的文件. 总结
以上是内存溢出为你收集整理的android – Gradle错误:无法打开zip文件全部内容,希望文章能够帮你解决android – Gradle错误:无法打开zip文件所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)