Error:Execution failed for task ':app:dexDebug'.

> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 2

想弄一下google地图,然后,直接通过android studio来生成了这个project。但是,运行的时候出现了以上错误。

找了一下资料。

http://stackoverflow.com/questions/28917696/errorexecution-failed-for-task-appdexdebug-com-android-ide-common-process

原因是以下:

It seems you have a jar file or a lib appearing multiple times.

So, remove the .jar file from the lib folder then:

Build > Rebuild

翻译过来大概是:

就是说jar文件或者lib文件出现了多次。

所以在把lib中对应的.jar文件移除就可以了。然后再rebuild

BUT!!人生最厉害就是这个BUT了。

作为初学者,其实不懂什么叫.jar,更不知道它在哪。

还好我有另外一个解决办法。

I had the same problem error that is shown, i solve it by adding

defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}

I had this problem cause i exceeded the 65K methods dex limit imposed by Android i used so many libraries

在Gradle Scripts中

build.gradle(Module:app)文件里,


找到defaultConfig,在里面添加

multiDexEnabled true

也就是下面这样。
defaultConfig {
multiDexEnabled true

}

然后再找了一下multiDexEnabled的作用是什么。
然后就找到了,
造成以上问题的原因。
应用中的Dex 文件方法数超过了最大值65536的上限,简单来说,应用爆棚了. 要想详细了解一下,可以看以下博客链接。作为初学者的我就不看了。主要是因为懒
时之沙: http://blog.csdn.net/t12x3456    (来自时之沙的csdn博客)
http://blog.csdn.net/t12x3456/article/details/40837287

BUG Error:Execution failed for task ':app:dexDebug'.的更多相关文章

  1. 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 ...

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

    最新项目中遇到了 Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.Proces ...

  3. Error:Execution failed for task ':app:dexDebug'.

    com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ...

  4. Error:Execution failed for task ':app:clean'.

    运行时出现 Error:Execution failed for task ':app:clean'. 错误,Builld->Clean Project即可.

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

    使用android studio 时,编译成功但用build apk时却报错 环境: android studio 1.5, jdk1.7 错误:Error:Execution failed for ...

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

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

  7. Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决记录

    转载请标明出处: http://blog.csdn.net/lxk_1993/article/details/50511172 本文出自:[lxk_1993的博客]:   3个错误non-zero e ...

  8. Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs f

    今天调试安卓程序遇到的问题Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching fa ...

  9. 异常问题解决Error:Execution failed for task ':app:processDebugManifest'

    Error:Execution failed for task ':app:processDebugManifest' www.MyException.Cn  网友分享于:2015-12-28  浏览 ...

随机推荐

  1. 海量jQuery插件

    转自:http://blog.csdn.net/zzq58157383/article/details/6900142 提醒大家在使用的时候注意jQuery包的版本问题,最好是使用相同的版本,因为使用 ...

  2. 遍历Dataset并输出数据实例

    转自:http://www.cnblogs.com/csdm/archive/2010/02/02/1661808.html <%@ Page Language="C#" A ...

  3. 修改Oracle数据库用户的密码

    修改数据库用户system密码的两个方法: 方法一: alter user system identified by password; 方法二: password system;

  4. HDOJ/HDU 2163 Palindromes(判断回文串~)

    Problem Description Write a program to determine whether a word is a palindrome. A palindrome is a s ...

  5. Shell编程之函数调用

    Shell中的函数调用的使用方法见我下面的代码示例: #!/bin/bash # value init ExP="adb shell /data/local/tmp/vpxdec --yv1 ...

  6. phonegap与google analytics整合

    用phonegap开发的app接近尾声,需要整一个谷歌分析进去. 1.首先申请一个GA帐号,在“what would you like to track”下选择APP

  7. 采集爬虫中,解决网站限制IP的问题? - wendi_0506的专栏 - 博客频道 - CSDN.NET

    采集爬虫中,解决网站限制IP的问题? - wendi_0506的专栏 - 博客频道 - CSDN.NET undefined

  8. Linux下常用I/O模型

    Linux异步I/O是Linux内核中提供的一个相当新的增强.它是2.6版本内核的一个标准特性,异步非阻塞I/O背后的基本思想是允许进程发起很多I/O操作,而不用阻塞或等待任何操作完成.稍后或在接收到 ...

  9. Yii中Ajax的使用,如收藏功能

    view中 <?php $cs=Yii::app()->clientScript; $cs->registerScriptFile('http://ajax.googleapis.c ...

  10. NOIP-2003 加分二叉树

    题目描述 设一个n个节点的二叉树tree的中序遍历为(1,2,3,…,n),其中数字1,2,3,…,n为节点编号.每个节点都有一个分数(均为正整数),记第i个节点的分数为di,tree及它的每个子树都 ...