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.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Library/……/java” finished with non-zero exit value 2
错误原因:
这个异常在Android Studio编译运行的时候出现,原因是项目中引用了重复的jar包,这可能是因为新引入的library module中有和主项目中重复引用的jar包,需要重点检查 Android 兼容包 support-v4 和 support-v7 包,还有一些常用的开源项目,例如Gson,Nineoldandroids…,这些常用的开源项目有可能在你引用的 library 项目中已经被引用过了。
解决办法:
解决这个问题我们只需要删除主项目中 libs 文件夹中和 library中重复的部分即可,另外,我推荐大家改变将 jar 包放在 libs 目录中的习惯,而使用 Gradle 构建,在 module 下的 build.gradle 目录下将
dependencies {compile files('libs/nineoldandroids-2.4.0.jar')
}
- 1
- 2
- 3
或
dependencies {compile fileTree(dir: 'libs', include: ['*.jar'])
}
- 1
- 2
- 3
改为
dependencies {compile 'com.nineoldandroids:library:2.4.0'
}
- 1
- 2
- 3
在参考链接中,我发现一个类似的异常
Error:Execution failed for task ‘:app:dexDebug’.
> com.android.ide.common.internal.LoggedErrorException
出现这个错误是因为主项目和Library项目中都引用了 compile ‘com.nineoldandroids:library:2.4.0’ ,但我在最新的 Android Studio 1.3 Preview 和 Gradle 2.3中给主项目和Library项目进行了一次模拟,却没有出现该异常,根据问题中给出了 build.gradle 文件,这可能是因为使用了低版本Android Studio 或 Gradle 的缘故,所以大家最好还是在项目中检查一下,library项目中已经引入的jar,library就不要再引入到主项目中了。
参考链接:
http://stackoverflow.com/questions/27675717/gradle-error-execution-failed-for-task-appdexdebug/27675841
转载于:https://www.cnblogs.com/zishentai-1/p/4932149.html
Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException相关推荐
- Error:Execution failed for task ':myapp:dexDebug'. com.android.ide.common.process.ProcessExcepti
错误如题所示:Error:Execution failed for task ':myapp:dexDebug'. com.android.ide.common.process.ProcessExce ...
- android dex2oatd e,解決android項目Error:Execution failed for task ':app:dexDebug'.ebug'錯誤
先上錯誤信息:Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessEx ...
- Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.tran
错误造成的原因: 为了连接网络,我导入的一个Xutils的jar包,然后发现还是还是有原理的老问题,编译版本太高了,需要相应的moudle中增加 在相应的module下的build.gradle中加入 ...
- 完美解决Error:Execution failed for task ':APP:transformClassesWithDexForDebug'...问题
今天下载一个demo运行出现问题,错误如下图 我的问题是JDK 1.8 版本问题问题,我吧1.8改成1.7运行成功 这个实在app下面的build.gradle 相信大伙在Android开发过程中都避 ...
- 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决
在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. & ...
- 安卓开发遇到Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
问题如下: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api. ...
- Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决记录
3个错误non-zero exit value 1: non-zero exit value 2: non-zero exit value 3(一下方法亲测好用) Error:Execution fa ...
- 解决方案:Error:Execution failed for task ‘:app:compileDebugAidl‘. > aidl is missing
解决方案:Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing 参考文章: (1)解决方案:Err ...
- Error:Execution failed for task ':app:clean'.
运行时出现 Error:Execution failed for task ':app:clean'. 错误,Builld->Clean Project即可. 转载于:https://www.c ...
最新文章
- 【转】Asp.net控件开发学习笔记整理篇 - WebControl基类
- array_uniquee php_【性能为王】从PHP源码剖析array_keys和array_unique
- ajax前台multipartfile,在SpringBoot中使用Ajax方式MultipartFile上传失败
- hello ,test livewriter
- 多线程暂停的一些方法区别
- 合并两个有序链表-递归
- java开发面试自我介绍模板_java程序员面试自我介绍范文(精选3篇)
- python round函数
- html如何设置自动点击事件,使用javascript给html元素添加click事件
- 减少资源占用 Vista操作系统瘦身大法
- Go手动安装pkg包初体验
- 学术论文检索--搜索引擎篇
- 8.3 单位矩阵和逆矩阵
- 让iPad认识一下Windows系统
- 红米note3全网通版刷机救砖 9008强刷(无需短接)
- 大数据毕设 - 网络游戏数据分析与可视化(python 大数据)
- python爬虫设计模式_Python爬虫进阶一之爬虫框架概述
- 抖音怎么注销账号?操作流程步骤有哪些?
- FCC JavaScript 算法和数据结构 正则表达式
- Fragment overlap problem
热门文章
- c 宏定义用法#define
- 调用API弹出打印机属性对话框
- web标准的商业价值
- 巧用CSS的RevealTrans滤镜
- DataBind数据核心
- ATL::CStringA和std::string之间转换的一些误区
- OpenCV支持的图像格式
- opencv图像处理梯度边缘和角点
- c语言规定预处理命令必须以什么开头,C语言规定预处理命令必须以___________开头...
- 学计算机一定要加班吗,老梁推荐:毕业后经常加班的几类专业,工作压力大,对能力要求很高...