4

我有个问题。我有一个用 monodroid 库构建的应用程序。android sdk 4.0.3 版本(API 级别 15),GoogleAdMobAdsSdk v.6.4.1。我制作了单独的项目以将 adsdk 导入 xamarin,添加到 Metadata.xml 属性。这个项目编译没有错误。但是当我从我的 monodroid 应用程序中引用这个项目时,我得到一个错误:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 3. Output: 
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
    at com.android.dx.util.IntList.growIfNeeded(IntList.java:274)
    at com.android.dx.util.IntList.add(IntList.java:217)
    at com.android.dx.util.LabeledList.addLabelIndex(LabeledList.java:96)
    at com.android.dx.util.LabeledList.set(LabeledList.java:184)
    at com.android.dx.rop.code.BasicBlockList.set(BasicBlockList.java:77)
    at com.android.dx.ssa.back.SsaToRop.convertBasicBlocks(SsaToRop.java:260)
    at com.android.dx.ssa.back.SsaToRop.convert(SsaToRop.java:124)
    at com.android.dx.ssa.back.SsaToRop.convertToRopMethod(SsaToRop.java:70)
    at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:102)
    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 com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:91)
 (MyMegaMonoDroidApplication)

我的错误在哪里?恩X。

4

1 回答 1

0

请指定 Java Heap Size = 1G(或 512M 可能对您有所帮助)。

这是 Xamarin Studio 的操作方法https://stackoverflow.com/a/24833518/883738

在 Visual Studio 中,您应该在Android 项目属性中执行此操作

于 2015-11-19T16:16:41.777 回答