昨天在编译运行(Run As Android Application)同事写的应用(移植)时,提示Unable to execute dex: Java heap space,刚开始以为是Android SDK没装好,于是我写了个Hello Android程序来验证,Hello Android可以运行。
于是,我Google了一下,据说是因为升级了ADT缘故(好像是Android小组的回复),将最新的ADT换回之前的,或者使用Android小组(?)说的Fix了的版本就可以了(这一点我没有试验)。
其实,继续使用ADT14也是可以的,这需要修改Eclipse的配置文件,也就是网上很多人说的那样,修改Eclipse安装目录下eclipse.ini文件:
1)在文件开头添加
-vm
D:\Program Files\Java\jre6\bin\javaw.exe
其中,D:\Program Files\Java\jre6是本人机器上JRE的路径,需要根据实际情况修改
2)搜索–launcher.XXMaxPermSize,将其下一行的
256m
改为
512m
其中,红色标出的部分可能不同的Eclipse版本,数字(256)不同。
3)搜索-vmargs
-vmargs
-Xms40m
-Xmx384m
将
-Xms40m
-Xmx384m
改为
-Xms512m
-Xmx1024m
并在其后加上
-XX:MaxPermSize=256m
同上,可能不同版本的Eclipse,红色标出的部分,数字(40和384)会不同。
然后重启Eclipse,编译出错的工程即可。
网上有人说这样不行,不知道是不是因为原文作者没有详细的描述怎么修改,因为在我机器上解决了这个问题
分享到:
相关推荐
nested exception is java.lang.OutOfMemoryError: Java heap space org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap...
Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project
ubuntu 下vim配置,包括语法高亮,backspace。
spring-petclinic-master运行mvn install报错:Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.19:validate (default) on project spring-petclinic: Formatting violations ...
在Windows平台下安装PHP后,在使用PHP的exec、shell_exec等函数时,经常会遇到报错:unable to fork...,这实际上是因为PHP对cmd.exe没有足够的权限引起的。
android引入外部jar包弹出以下错误[2020-04-23 13:08:25 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/loopj/android/http/AsyncHttpClient$1; [2020-04-23 13:08:25 - Halloworld1] ...
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:463) at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405) ...
idea创建Maven项目时,报错显示Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources,并且Maven插件内看不到 mybatis-generator。如下图: 折腾了好久发现配置放错地方了,...
init:rcS post-stop process(1160) init:rcS post-stop process(923)
如果报错:Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes;请删掉PalmCampus工程下lib包里的android-support-v4.jar】
64k的各种异常 ...Unable to execute dex: method ID not in [0, 0xffff]: 65536 或者 UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536 at com.
thingsboard编译错误 Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project js-executor: Failed to run task: 'npm install' failed. 该错误如果是3.0上的,请将...
-bash: /usr/local/jdk/jdk1.8.0_181/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 安装完后 java -version 查看版本出现: 原因是:没有那个文件或目录,找了很久发现需要...
java.lang.SecurityException: class "org.apache.commons.collections.SequencedHashMap"'s signer information does not match signer information of other classes in the same package at java.lang....
failed to execute script 解决方案+命令行执行传参exe
如果报错:Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes;请删掉PalmCampus工程下lib包里的android-support-v4.jar
ExecuteSQL.java
在<plugins></plugins>中添加 <groupId>org.apache.maven.plugins <artifactId>maven-compiler-plugin <version>3.8.1 <source>1.8 <target>1.8 </plugin>
主要介绍了Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1的解决办法的相关资料,需要的朋友可以参考下
用于分包,解决 android 打包时报Unable to execute dex: method ID not in [0, 0xffff]: 65536