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

  1. defaultConfig {
  2. // Enabling multidex support.
  3. multiDexEnabled true
  4. }

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)文件里,

  1.  

找到defaultConfig,在里面添加

  1. multiDexEnabled true
  2.  
  3. 也就是下面这样。
  1. defaultConfig {
  1. multiDexEnabled true
  2.  
  3. }
  4.  
  5. 然后再找了一下multiDexEnabled的作用是什么。
    然后就找到了,
    造成以上问题的原因。
    应用中的Dex 文件方法数超过了最大值65536的上限,简单来说,应用爆棚了.
  6. 要想详细了解一下,可以看以下博客链接。作为初学者的我就不看了。主要是因为懒
    时之沙: http://blog.csdn.net/t12x3456    (来自时之沙的csdn博客)
  1. 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. [LeetCode#250] Count Univalue Subtrees

    Problem: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all ...

  2. C#面向对象——成员变量及封装

    namespace 面向对象5_22 { class Animal { private string _Type; public string Type { get { return _Type; } ...

  3. bzoj2242

    快速幂 扩展欧几里得 baby-step-giant-step 可以自行baidu 程序附部分注释 ; type link=^node;      node=record        re,wh:l ...

  4. C#中类的默认访问是私有的

    如果类前面没有访问修饰符的话,那里面的成员默认是私有private. 下面的代码是从MSDN上拷的,那个d它说明了私有:class Employee{private int i;double d; / ...

  5. winfrom存储txt日志函数

    参考微信支付SDK的代码,抽取出来的winform存储记事本日志函数: #region 存储日志 public string path = Application.StartupPath + &quo ...

  6. 有7g和2g的砝码各一个,怎样称可以3次把140g东西分为50g和90g???????

    第一次:等分 50和90为   70 70 2.   7g 和2g  ,取出一个70中的9g   ,  61   70 3.利用 9g和2g砝码,取出61中的11克,前面的9 和 11 都放进70

  7. 项目杂记(MONTHS_BETWEEN,Having ,Spool)

    1,oracle中计算年龄: select FLOOR(MONTHS_BETWEEN(SYSDATE, to_date('20130728', 'yyyymmdd')) / 12), trunc(mo ...

  8. bzoj 3531 [Sdoi2014]旅行(树链剖分,线段树)

    3531: [Sdoi2014]旅行 Time Limit: 20 Sec  Memory Limit: 512 MBSubmit: 876  Solved: 446[Submit][Status][ ...

  9. 18. 4Sum

    #include <string>#include <stack>#include <vector>#include <map>#include < ...

  10. 【转】谁说Vim不是IDE?(二)

    谁说Vim不是IDE?(二)   环境配置 “如果你认为Vim只是一个文本编辑器,你就输了”——来自Vim老鸟 Vim以简洁的方式提供了丰富的配置功能,主要配置体系由一个文件和文件夹组成.在一台安装了 ...