I am having trouble compiling the Distriqt Facebook ANE for Android.
It works fine on iOS but not on Android.
The error message is:
dx tool failed:
UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: Java heap space at com.android.dx.cf.code.ExecutionStack.copy(ExecutionStack.java:66) at com.android.dx.cf.code.Frame.copy(Frame.java:98) at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:786) at com.android.dx.cf.code.Ropper.doit(Ropper.java:742) at com.android.dx.cf.code.Ropper.convert(Ropper.java:349) at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:280) at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:137) at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:93) at com.android.dx.command.dexer.Main.processClass(Main.java:729) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) at com.android.dx.command.dexer.Main.access$300(Main.java:83) at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) at com.android.dx.command.dexer.Main.processOne(Main.java:632) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106)
ADT command line: ...
Tried with AIR18 and AIR 16 (updated dx.jar from distriqt tutorial). My manifest includes all 3 needed extensions:
<extensionID>com.distriqt.Core</extensionID>
<extensionID>com.distriqt.GooglePlayServices</extensionID>
<extensionID>com.distriqt.FacebookAPI</extensionID>
Removing GooglePlayServices makes compilation possible but app crashes when initializing the FacebokAPI.
Using AIR16 without the updated dx.jar also crashes the app directly at startup. The catlog states the following exception:
08-23 14:53:14.793 E/AndroidRuntime(3178): java.lang.RuntimeException: Unable to get provider com.facebook.FacebookContentProvider: java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider in loader dalvik.system.PathClassLoader[/data/app/air.my.com.zas.lefiner-1.apk]
08-23 14:53:14.793 E/AndroidRuntime(3178): Caused by: java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider in loader dalvik.system.PathClassLoader[/data/app/air.my.com.zas.lefiner-1.apk]
Oddly enough the Distriqt GooglePlusANE which uses Core and GooglePlayServices works fine on both platforms. So i strongly assume there is something wrong with the FacebookAPI extension.
Any help is very much appreciated!
If You are using Intellij IDEA
increase Compiler heap size
in Actionscript
& Flex
compiler. This fixed the issue for me.