Android Studio Error -- Could not create the Java Virtual Machine
: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的更多相关文章
- weblogic10.3 启动报错 Unrecognized option: -jrockit Error: Could not create the Java Virtual Machine
		
今天在使用weblogic10.3+jdk7创建domain的时候,建好domain后启动报如下错误信息: Unrecognized option: -jrockitError: Could not ...
 - 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 ...
 - kettle启动“Error: could not create the Java Virtual Machine”
		
因为我的操作系统是32bit,而Ketttle的Spoon脚本中,默认是PENTAHO_DI_JAVA_OPTIONS="-Xms1024m" "-Xmx2048m&qu ...
 - myeclipse 10配置jboss 7.1.1无法启动Error: Could not create the Java Virtual Machine
		
myeclipse 10中配置jboss 7.1.1,多写了个server name,结果死活启动不了.后来,发现了这个细节. 错误显示: 错误源头: 删掉Server name后,可以完美启动 小问 ...
 - weblogic安装使用: Could not Create the Java Virtual Machine
		
第一次使用weblogic,完全不明白是怎么一回事!找安装包花了大把时间!找到了不知道怎么安装 -- _ --||| 找了一篇安装文档<weblogic 安装部署手册.doc>, 位于:[ ...
 - 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 ...
 - 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 ...
 - Failed to create the Java Virtual Machine.问题的解决
		
运行Eclipse,出现了"Failed to create the Java Virtual Machine."错误: 解决的办法是在Eclipse的解压目录下找到eclipse ...
 - 【 Failed to create the Java Virtual Machine】的2种解决方式
		
初学Android,下载并安装好了eclipse,ADT和SDK之后,打开Eclipse时,出现: Failed to create the Java Virtual Machine 点击确定,ecl ...
 
随机推荐
- VR虚拟现实的工作原理,你知道多少?【转】
			
VR虚拟现实经过几年的预热,已经开始呈现爆发式增长,要了解VR虚拟现实,就需要了解其工作原理,了解工作原理之前,我们就需要弄清楚眼睛是如何看清事物的. 眼睛瞳孔后有晶状体,也就是眼珠子.眼睛的背面有感 ...
 - 表格中的IE BUG
			
在表格应用了跨列单元格后,在IE6/7下当跨列单元格中的元素长度超过其跨列单元格中第一个单元格的宽度时会产生换行,如下所示: 解决方法: 1. 设置 table 的 'table-layout' 特性 ...
 - XDebug 教程
			
安装说明: PHP调试时,不得不提XDEBUG这个调试利器.学习PHP以来,几乎所有的问题我都利用它来解决. 首先关于如何安装,不在赘述,请自行google之.(需要特别注意的是:PHP5.2 和5. ...
 - Material Design学习之 Bottom navigation
			
转载请注明出处:王亟亟的大牛之路 礼拜4一天由于事假没有去单位然后礼拜3由于生日也没写文章,今天一早上班就补一篇MD的内容.这一篇是关于颇有争议的Bottom navigation相关内容(主要是翻译 ...
 - n皇后问题[分支限界法]
			
问题: 如何能够在 n×n 的国际象棋棋盘上放置八个皇后,使得任何一个皇后都无法直接吃掉其他的皇后?为了达到此目的,任两个皇后都不能处于同一条横行.纵行或斜线上. 分析: 我们可以用一串数字来表示问题 ...
 - JavaScript | 基础表单验证(纯Js)
			
———————————————————————————————————————————— 基础表单验证(纯js) - - - - - - - - - - - - - - - - - - - - - - ...
 - ROS示例----导航功能包Husky_exploration
			
ROS导航功能包示例husky amcl gmapping slam exploration 此功能包包含如下文件: 结构如下: $ tree -L 2 . ├── CMakeLists.txt -& ...
 - UnicodeEncodeError: ‘gbk’ codec can’t encode character u’\u200e’ in position 43: illegal multibyte sequence
			
[问题] python中已获取网页: http://blog.csdn.net/hfahe/article/details/5494895 的html源码,其时UTF-8编码的. 提取出其标题部分: ...
 - 工作总结  "2017年8月11日" 转换为datatime
			
string strr = "2017年8月11日"; Console.WriteLine((Convert.ToDateTime(strr)).ToString("yy ...
 - 转FTP协议详解
			
转自:http://www.cnblogs.com/li0803/archive/2010/11/16/1878833.html FTP 是File Transfer Protocol(文件传输协议) ...