我一直在尝试使用Android项目设置gwt,并在将sdk添加到我的构建路径后,编译就会出现这个问题。
我正在使用IntelliJ Ultimate 13.1,Android应用程序是随附的骨架。
这是完整的追溯:
Error:Android Pre Dex: [gwt-user.jar] Unable to execute DX
Error:Android Pre Dex: [gwt-user.jar] java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.util.Bits.makeBitSet(Bits.java:38)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.util.BitIntSet.<init>(BitIntSet.java:35)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.ssa.SetFactory.makeDomFrontSet(SetFactory.java:66)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.ssa.DomFront.run(DomFront.java:103)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.ssa.SsaConverter.placePhiFunctions(SsaConverter.java:297)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:51)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:98)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:299)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main.processClass(Main.java:682)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
Error:Android Pre Dex: [gwt-user.jar] at com.android.dx.command.dexer.Main.run(Main.java:230)
Error:Android Pre Dex: [gwt-user.jar] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:Android Pre Dex: [gwt-user.jar] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
Error:Android Pre Dex: [gwt-user.jar] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error:Android Pre Dex: [gwt-user.jar] at java.lang.reflect.Method.invoke(Method.java:606)
Error:Android Pre Dex: [gwt-user.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:161)
Error:Android Pre Dex: [gwt-user.jar] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:294)
答案 0 :(得分:0)
披露:我从未做过任何严肃的Android开发者,而且我实际上并不知道&#34; pre dex&#34;真的意思是。
绝对没有理由将gwt-user打包到Android应用中。
要么包装由GWT生成的JS,你只需要在编译时使用GWT;或者您想使用RequestFactory,您应该使用requestfactory-client.jar
。在其他情况下,您可能希望使用不在requestfactory-client
中的其他GWT类(例如RegExp
或SafeHtml
),在这种情况下,您必须提取它们进入你自己的JAR,或者只是使用gwt-servlet
。