先说下背景:随着各种第三方框架的使用,studio在编译打包成apk时,在dex如果发现有相同的jar包,不能创建dalvik虚拟机。一个apk,就是一个运行在linux上的一个虚拟机。

上图就是一直报错的问题,说是一个致命的错误,不能创建JVM。

找了下stackoverflow,发现这样的问题比比皆是,确没有一个解决我的问题的。有的说是AS2.1中的gradle和jdk不兼容,我看有1.8出这个问题,也是1.7出这个问题,先排除了jdk问题。然后以有人说是有相同的包导致的。我仔细检查了下。发现也没有相同的包啊。。

正在绝望的时候,再看了下这个错误。有一行“Invalid maxinum heap size:-Xmx4g”

然后是这里注释下,天啊,竟然编译通过了!

虽然不是技术上碰到的难题,也因为这种问题,让我竟受折磨。所以,必须让它上到我碰到的坑笔记中。

Android studio中的一次编译报错’Error:Execution failed for task ':app:transformClassesWithDexForDebug‘,困扰了两天的更多相关文章

  1. 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决

    在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'.&g ...

  2. cordova编译报错:Execution failed for task ':processDebugResources'

    cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...

  3. Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.Exec

    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.> com.android.build.api.tr ...

  4. 【Android】AndroidStudio打包apk出现的一些问题 `Error:Execution failed for task ':app:lintVitalRelease'.

    作者:程序员小冰,CSDN博客:http://blog.csdn.net/qq_21376985, QQ986945193 公众号:程序员小冰 1,错误代码: `Error:Execution fai ...

  5. 关于android studio 出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法

    Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 2018年 ...

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

  7. Android Studio 编译错误 Error:Execution failed for task ':app:buildInfoDebugLoader'.

    今天来到打开昨天的项目运行正常,然后改动了一点代码编译报错: Error:Execution failed for task ':app:buildInfoDebugLoader'. > Exc ...

  8. Android中使用databinding编译时出现的error:Execution failed for task ':app:dataBindingProcessLayoutsDebug'

    Windows环境下使用svn对AndroidStudio更新代码时,总会在源文件中出现一堆乱码,尤其是xml文件中的乱码,不仅找起来费劲,改起来更费劲. 最近从svn更新代码之后,编译时出现了下面这 ...

  9. Android Studio Error:Execution failed for task ':app:preDebugAndroidTestBuild'.彻底解决的方法以及修改AScompileSDKVersion

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

随机推荐

  1. SpringMVC mock测试详解

    @RunWith(SpringRunner.class) @SpringBootTest(classes = WebmanagerApplication.class) //配置事务的回滚,对数据库的增 ...

  2. Python盗号原理-代码实现截屏键盘记录远程发送(不要做坏事)

    这年头盗号的从出不穷,不是脱裤就是社工钓鱼.今天呢我们就以前面的几篇技术文章做铺垫,来讲一下python盗号的原理(学习用途,请勿用于违法犯罪),知己知彼方能百战不殆嘛. 脱裤我们就不多提了,无非就是 ...

  3. centos6 网卡配置,多IP设置

    ##云服务器 centos6网卡配置 #设置出口IP vim /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=seth0 #网卡名称 BOOTPROTO ...

  4. range和xrange的区别详解

    两种用法介绍如下:1.range([start], stop[, step])返回等差数列.构建等差数列,起点是start,终点是stop,但不包含stop,公差是step.start和step是可选 ...

  5. Python中什么是变量Python中定义字符串

    在Python中,变量的概念基本上和初中代数的方程变量是一致的. 例如,对于方程式 y=x*x ,x就是变量.当x=2时,计算结果是,当x=5时,计算结果是25. 只是在计算机程序中,变量不仅可以是数 ...

  6. [BBS]搭建开源论坛之Jforum搭配开源CKEDITOR

    本文作者:sushengmiyan 本文地址:http://blog.csdn.net/sushengmiyan/article/details/47946065 使用默认的编辑器的时候,格式都无法保 ...

  7. SOAP Binding: Difference between Document and RPC Style Web Services

    SOAP Binding: Difference between Document and RPC Style Web Services 20FLARES Twitter 1Facebook 9Goo ...

  8. 对 /dev/shm 认识

    一./dev/shm理论 /dev/shm/是linux下一个非常有用的目录,因为这个目录不在硬盘上,而是在内存里.因此在linux下,就不需要大费周折去建 ramdisk,直接使用/dev/shm/ ...

  9. [OpenCV] How to install opencv by compiling source code

    Introduction Install OpenCV and its dependence ! STEPs 1, compiler sudo apt-get install build-essent ...

  10. android开发中使用到的一些设计者模式

    单例模式 概念:确保一个类只有一个实例,并且自行实例化并向整个系统提供整个实例. public class Singleton { private static volatile Singleton ...