今天使用 Android Studio 构建项目的时候出现了这个错误 compileDebugJavaWithJavac

通过搜索发现造成该问题的原因有很多需要结合具体的项目进行排查

通过 Android Studio 的 Terminal 输入 gradlew compileDebugJavaWithJavac 来进行原因查看

PS D:\gitlab\develop\ruixinAndroid_new> ./gradlew compileDebugJavaWithJavac
Unzipping C:\Users\lijingbo\.gradle\wrapper\dists\gradle-4.5.1-all\4alu8ppoj4agqqum265te8rc7u\gradle-4.5.1-all.zip to C:\Users\lijingbo\.gradle\wrapper\dists\gradle-4.5.1-all\4alu8ppoj4agqqum265te8rc7u
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
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:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.zip.ZipFile.<init>(ZipFile.java:164)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more

通过以上 Log , 可以看到是因为 gradle-4.5.1 解压失败造成的,进入到该目录,发现 gradle-4.5.1 没有下载完成,只下载了 50MB ,官网是97MB 。重新从官网下载就可以了。

参考:https://blog.csdn.net/u014453811/article/details/54582426/

Android Error:Execution failed for task ':app:compileDebugJavaWithJavac' 解决方案的更多相关文章

  1. Android Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency

    错误内容: Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency ...

  2. Android Studio Error:Execution failed for task ':app:compileDebugJavaWithJavac' 根本解决方法

    造成这种异常的原因有很多.具体的还是要去终端编译,查看到底是什么地方出错了,然后具体问题具体分析. 终端进入项目的根目录,然后输入命令 gradlew compileDebugJavaWithJava ...

  3. Android Error:Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher bg_btn.9.png

    使用Android Studio来进行图片背景设置,编译时发生了一个mergeDebugResources异常. 异常原因 这个异常的意思是对资源合并发生错误,那就是我使用的图片资源有问题,我使用的图 ...

  4. 异常:Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.

    碰到这个异常我也是挺无语的,因为Android Studio根本不会提示你详细的错误信息. 我们来看看这个博主:http://blog.csdn.net/runner__1/article/detai ...

  5. Error:Execution failed for task ':app:compileDebugJavaWithJavac'

    百度一下呗 查找了各种解决方案,都不对症. 最后发现,造成这种异常的原因有很多.具体的还是要去终端编译,查看到底是什么地方出错了,然后具体问题具体分析. 终端进入项目的根目录,然后输入命令 ./gra ...

  6. Error:Execution failed for task :app:transformClassesWithInstantRunForDebug解决方案

    转自https://blog.csdn.net/student9128/article/details/53026990

  7. Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

    转载请标明出处: http://www.cnblogs.com/why168888/p/5978381.html 本文出自:[Edwin博客园] 我引用compile 'com.squareup.re ...

  8. Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException

    异常Log: Error:Execution failed for task ‘:app:dexDebug’. > com.android.ide.common.process.ProcessE ...

  9. Android:Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

    今天开发Android项目时,导入了http有关架包后,程序编译报错如下: Error:Execution failed for task ':app:transformResourcesWithMe ...

随机推荐

  1. C#: 执行批处理文件(*.bat)的方法

    static void Main(string[] args) { Process proc = null; try { proc = new Process(); proc.StartInfo.Fi ...

  2. 【Java】 剑指offer(5) 从尾到头打印链表

    本文参考自<剑指offer>一书,代码采用Java语言. 更多:<剑指Offer>Java实现合集 题目 输入一个链表的头结点,从尾到头反过来打印出每个结点的值.结点定义如下: ...

  3. 006 Spark中的wordcount以及TopK的程序编写

    1.启动 启动HDFS 启动spark的local模式./spark-shell 2.知识点 textFile: def textFile( path: String, minPartitions: ...

  4. linux 之 汇编语言 的mov和movl sub 和subl add 和addl 的区别??

    AT&T汇编语言(Assembly Language)是UNIX下惯用的汇编语言(Assembly Language)各式 l,w,b是ATT汇编语言(Assembly Language)中用 ...

  5. linux下php命令无法使用如何解决

    本文主要和大家分享linux下php命令无法使用如何解决,测试是否添加php环境变量方法: 如下:输入php -v 显示 php 命令没有找到 [root@iz8vbhc4d7zoazstpw7gw8 ...

  6. 洛谷 P1464 Function【记忆化搜索】

    题目链接 题目描述 对于一个递归函数w(a,b,c) 如果a<=0 or b<=0 or c<=0就返回值1. 如果a>20 or b>20 or c>20就返回w ...

  7. Spring框架学习02——Spring IOC 详解

    1.Spring IOC的基本概念 IOC(Inverse of Control)反转控制的概念,就是将原本在程序中手动创建对象的控制权,交由Spring框架管理.当某个Java对象(调用者)需要调用 ...

  8. 操作系统概述(os 笔记一)

    操作系统概述 操作系统的目标和功能 1.目标:作为用户/计算机接口 ​ 计算机的使用人群大致可以分为三类,终端用户,程序开发者,操作系统设计人员. 对于终端用户,即应用程序的用户来说,他们通常不关注计 ...

  9. BASH if/while/until loop

    #/bin/bash ]; then counter=" counter1=" echo "for loop:" $); do echo $i done ); ...

  10. Codeforces757E.Bash Plays With Functions(积性函数 DP)

    题目链接 \(Description\) q次询问,每次给定r,n,求\(F_r(n)\). \[ f_0(n)=\sum_{u\times v=n}[(u,v)=1]\\ f_{r+1}(n)=\s ...