当构建android apk时,eclipse发生堆空间错误

时间:2014-01-14 03:16:55

标签: android eclipse

我在eclipse中构建和运行android apk时遇到了麻烦。我按照以下步骤进行日食。

选择我的Android应用程序ActivityA,右键单击AcitivityA - >属性 - > Java构建路径 - >添加库 - >用户库 - >选择我自己的android库,然后在Libraries选项卡中,取消选择android 4.3,选择我自己的构建sdk库。

然后,当我在设备上构建并运行我的应用程序时,eclipse因“无堆空间”错误而崩溃。我已经尝试过其他eclipse版本,比如Indigo 3.7和eclipse 4.2.2,我可以肯定它不是eclipse版本的问题。你能帮助我吗,或者我应该把它报告为日食的错误?非常感谢你的帮助。

我的Ubuntu 12.04环境,

java version: 1.6.0_45
android SDK: 4.3

我的eclipse.ini是:

--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

错误:

[2014-01-14 11:00:31 - Dex Loader] Unable to execute dex: Java heap space
[2014-01-14 11:00:35 - ActivityA] Conversion to Dalvik format failed: Unable to execute dex: Java heap space

详细错误:

!SESSION 2014-01-14 10:31:44.422 -----------------------------------------------
eclipse.buildId=M20120208-0800
java.version=1.6.0_45
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product

!ENTRY com.android.ide.eclipse.adt 4 0 2014-01-14 10:59:35.250
!MESSAGE Unable to execute dex: Java heap space
!STACK 0
java.lang.OutOfMemoryError: Java heap space
    at java.util.HashMap.addEntry(HashMap.java:753)
    at java.util.HashMap.put(HashMap.java:385)
    at java.util.HashSet.add(HashSet.java:200)
    at com.android.dx.ssa.DeadCodeRemover.run(DeadCodeRemover.java:122)
    at com.android.dx.ssa.DeadCodeRemover.process(DeadCodeRemover.java:61)
    at com.android.dx.ssa.Optimizer.runSsaFormSteps(Optimizer.java:161)
    at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:100)
    at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:73)
    at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:273)
    at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:134)
    at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:87)
    at com.android.dx.command.dexer.Main.processClass(Main.java:487)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
    at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:422)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
    at com.android.dx.command.dexer.Main.run(Main.java:209)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:187)
    at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:786)
    at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:597)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)

0 个答案:

没有答案