我是Android Studio的新手,刚刚开始通过Udacity的在线课程“开发Android应用程序”学习。问题是,我正在开发的项目与课程“阳光”保持一致,但无法正确同步。
**2017-03-04 08:14:32,358 [ 61978] WARN - nal.AbstractExternalSystemTask - Cause: error in opening zip file
com.intellij.openapi.externalSystem.model.ExternalSystemException: Cause: **error in opening zip file**
at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:86)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:361)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:769)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:749)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:227)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:72)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(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:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:415)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:494)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:155)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:128)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:307)
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)
Caused by: java.util.zip.ZipException: **error in opening zip file**
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:139)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:133)
... 4 more**
只需删除gradle文件夹从您的主目录!即
~/<username>/.gradle/wrapper/dists/<gradle-name>
其中gradle-name
是必须删除的发行版。然后打开android studio,重新打开项目来同步分级。
分级代码:
我试图用AS0.8.6导入一个新的gradle Android项目(也尝试过0.8.7)。当导入时,我得到以下错误 从我的研究来看,这很可能是下载gradle包装器的问题。 根据SO上的另一篇文章(https://stackoverflow.com/a/23839694/413254)的建议,我尝试删除~/.gradle文件夹。在重新启动时,同样的事情会发生。 如果我尝试运行,我会得到以下错误:
无法从Github生成android项目,错误为“Gradle sync failed:Cause:error=0,spawn failed”有关详细信息,请参阅IDE日志(帮助|显示日志)(434ms) 任何想法 ?
我试图用以下依赖项构建gradle。但它不是编译。我尝试了很多,通过查看论坛来更改版本。我在“项目结构”对话框中搜索依赖项,发现了以下两个。 实际上,我用的是两台电脑。这是在另一台电脑上制作的,有以下功能 仍然没有运气和gradle建造每次需要20-25分钟 主要build.gradle 应用build.gradle
问题内容: 我有一个Jar文件,其中包含其他嵌套的Jar。当我在该文件上调用新的构造函数时,出现一个异常: java.util.zip.ZipException:打开zip文件时出错 当我手动解压缩此Jar文件的内容并再次将其压缩时,它可以正常工作。 我仅在WebSphere 6.1.0.7和更高版本上看到此异常。相同的东西在tomcat和WebLogic上也可以正常工作。 当我使用JarInpu
当我今天早上启动我的项目时,它随机给我一条消息,说Gradle项目同步失败。基本功能(如编辑、调试)将无法正常工作。Android Studio中的代码。我看了人们为这个问题提出的其他答案,但他们一直没有工作。我取消了我的chach/重启了我的项目,但是没有运气。我也从我的项目文件夹中删除了我的. gradle文件夹,但是仍然没有运气。如果你们中的任何人能帮我,那就太棒了!这不是昨天我在做项目的时