加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – Android studio – 无法完成gradle执行 – 打开zip文件

发布时间:2020-12-15 07:38:49 所属栏目:Java 来源:网络整理
导读:我是 android开发和 android studio IDE的新手. 我从bitbucket检出了一个项目,当我尝试编译它时,我收到以下错误: Failed to complete Gradle Execution Cause: error in opening zip file. 我的gradle-wrapper.properties如下: distributionBase=GRADLE_US
我是 android开发和 android studio IDE的新手.

我从bitbucket检出了一个项目,当我尝试编译它时,我收到以下错误:

Failed to complete Gradle Execution

Cause:
error in opening zip file.

我的gradle-wrapper.properties如下:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http://services.gradle.org/distributions/gradle-1.11-all.zip

我无法从此获取太多信息,但完整日志指出:

2014-05-23 14:06:28,950 [ 32077] WARN –
nal.AbstractExternalSystemTask – Cause: error in opening zip file
com.intellij.openapi.externalSystem.model.ExternalSystemException:
Cause: error in opening zip file at
org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:206)
at
org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:116)
at
org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:64)
at
com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at
com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at
com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at
com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at
com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at
com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
at
com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
at
com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
at
com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:467)
at
com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:546)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at
com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373)
at
com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) at
com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)

2014-05-23 14:06:28,950 [ 32077] WARN –
.project.GradleProjectImporter – 2014-05-23 14:06:28,951 [ 32078]
INFO – .project.GradleProjectImporter – Cause: error in opening zip
file

我正在使用Android studio 0.5.2.

有人能指出我如何解决这个问题的正确方向吗?

解决方法

“打开zip文件时出错”往往意味着Gradle已下载的文件以某种方式损坏 – 这可能是Gradle本身的下载(包装器所做的),或Gradle已下载以运行您的构建的依赖项.

Gradle不会尝试检测或解决问题,因此您需要手动修复它.解决方案通常是清除Gradle的下载缓存,让它获得所需内容的新副本.为此,请删除主目录和项目根目录中的.gradle目录,然后再次尝试构建.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读