:app:dexDebug
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit. FAILED FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
E:\Program Files\adt-bundle-windows-x86-20140702\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output E:\android\workspace\DialogDemo\app\build\intermediates\dex\debug --input-list=E:\android\workspace\DialogDemo\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
1
Output:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit. * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED

Gradle打包的时候经常出现此错误,命令--stacktrace

Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

目前google and 百度查询有两种解决方案

1.设置java的

-Xms128m
-Xmx512m
-XX:MaxPermSize=250m

修改这三个参数

2.升级JDK

经过测试2种方案都不行

通过

dx.bat --dex

命令的dx.bat脚本有这样一句代码

REM By default, give dx a max heap size of 1 gig and a stack size of 1meg.
rem This can be overridden by using "-JXmx..." and "-JXss..." options below.
set defaultXmx=-Xmx1024M
set defaultXss=-Xss1m
set defaultXmx=-Xmx1024M

原因就是此处设置的Xmx为1024M,编译打包APK时java虚拟机内存空间不足,修改为512M即可正常编译打包了。

set defaultXmx=-Xmx512M

Android Studio Error -- Could not create the Java Virtual Machine的更多相关文章

  1. weblogic10.3 启动报错 Unrecognized option: -jrockit Error: Could not create the Java Virtual Machine

    今天在使用weblogic10.3+jdk7创建domain的时候,建好domain后启动报如下错误信息: Unrecognized option: -jrockitError: Could not ...

  2. Eclipse 出错 Error:Could not create the Java Virtual Machine Error:A fatal exception has occurred

    提示如下: scala compile server. error:could not create the java machine.Error: A fatal exception has occ ...

  3. kettle启动“Error: could not create the Java Virtual Machine”

    因为我的操作系统是32bit,而Ketttle的Spoon脚本中,默认是PENTAHO_DI_JAVA_OPTIONS="-Xms1024m" "-Xmx2048m&qu ...

  4. myeclipse 10配置jboss 7.1.1无法启动Error: Could not create the Java Virtual Machine

    myeclipse 10中配置jboss 7.1.1,多写了个server name,结果死活启动不了.后来,发现了这个细节. 错误显示: 错误源头: 删掉Server name后,可以完美启动 小问 ...

  5. weblogic安装使用: Could not Create the Java Virtual Machine

    第一次使用weblogic,完全不明白是怎么一回事!找安装包花了大把时间!找到了不知道怎么安装 -- _ --||| 找了一篇安装文档<weblogic 安装部署手册.doc>, 位于:[ ...

  6. Kafka中错误:Unrecognized VM option ‘UseCompressedOops’ Error: Clould not create the Java Vritual Machine. Error: A fatal exception has occurres . Program will exit.

    错误的描述: 在kafka安装目录下,执行 $ bin/zookeeper-server-start.sh config/zookeeper.properties & Unrecognized ...

  7. java virtual machine launcher Error:Could not create the Java Virtual Machine. Error:A Fatal exception has occurred,Program will exit.

    Error:Could not create the Java Virtual Machine. Error:A Fatal exception has occurred,Program will e ...

  8. Failed to create the Java Virtual Machine.问题的解决

    运行Eclipse,出现了"Failed to create the Java Virtual Machine."错误: 解决的办法是在Eclipse的解压目录下找到eclipse ...

  9. 【 Failed to create the Java Virtual Machine】的2种解决方式

    初学Android,下载并安装好了eclipse,ADT和SDK之后,打开Eclipse时,出现: Failed to create the Java Virtual Machine 点击确定,ecl ...

随机推荐

  1. iOS: 格式化新浪微博/QQ说说等等的发布时间

    介绍:对于一些社交工具,我们可以发布一些说说或者心情什么的,如新浪微博,QQ,微信等,发布成功后,上面都会有一个发布的时间. 这个时间并不是具体的NSDate类型,而是经过格式化过的符合一般标准的模式 ...

  2. 本机搭建PHP环境全教程(图文)

    为了更好的维护空间网站,研究和调试PHP程序,许多人需要在自己的计算机内搭建PHP环境.本文将介绍使用phpnow环境组件搭建的全过程.使用搜索工具,搜索phpnow<ignore_js_op& ...

  3. 为小团队协作和个人任务管理而生的Team应用

    今天主要给大家讲讲个人用户如何操作附个下载地址:https://coding.net/s/7a64f0d3-0fc3-4618-a490-d29651dae06b1.可直接在主页添加任务 任务被放在默 ...

  4. Android Exception 17(database or disk is full)

    android.database.sqlite.SQLiteFullException: database or disk is full delete some app,or clear cache

  5. EXTJS4自学手册——报表概述

    Ext画报表所涉及到的组件关系如下: Store:数据容器 Legend:图像说明 Axis:横.纵坐标 Series:报表图像

  6. C++五种迭代器之间的关系

    迭代器操作                      说明(1)所有迭代器p++                              后置自增迭代器++p                     ...

  7. Oculus rift DK2 新手使用设置

    为了获得更好的3D沉浸感体验,降低使用晕眩的可能性,使用DK2前,一定要针对使用者自身对DK2进行正确的设置.下面解释一下配置面板的一些参数和意义: Eye Relief滑竿应该和你的DK2两侧的调节 ...

  8. linux下使用tc(Traffic Control) 流量控制命令模拟网络延迟和丢包

    目录 TC案例 TC常用命令 TC安装 TC原理介绍 TC规则 TC操作原理 TC命名规则 TC单位 TC命令 TC案例 如何使用tc模拟网络延迟和丢包 修改网络延时:  sudo tc qdisc  ...

  9. curl 重定向问题

    今天在curl一个网站的时候遇到一个奇怪的问题,下面是输出: lxg@lxg-X240:~$ curl -L http://www.yngs.gov.cn/ -v * Hostname was NOT ...

  10. 牛散NO.1:MACD计啜诱多,勾魂枪连环夺命时

    上证日线“连环夺命勾魂枪” 话说MACD中圈C的回勾,好事者皆认为新的冲击波即将曙光再现.伴随着K线出现红柱中阳,更多的投资者将会被这一勾诱惑得群情亢奋,盲断行情又要 起来了.但往往事与愿违,“潘金莲 ...