This is not a duplicate question, I will post the links to the questions whose 'accepted' answers did not work for me.
I have been trying to integrate a third party library for my flex android application for a few weeks now, with no success. Unfortunately there is no reliable end-to-end documentation for the same. What little Adobe has documented on the topic is insufficient to say the least.
The tools I am using:
- ADT to package ANE from command line on Windows 7.
- Flash Builder to package the final APK (ANE with the flash part)
My directory structure for the ANE:
The ADT command I am using:
<Adt path>\adt -package -storetype PKCS12 -keystore ./cert.p12 -storepass <password> -target ane myane.ane ./build/ane/extension.xml -swc ./build/ane/*.swc -platform Android-ARM -platformoptions platform.xml -C ./build/ane/Android-ARM/ . -platform Android-x86 \ -C ./build/ane/Android-ARM/ .
Here are a few questions on Stack Overflow that I did refer to and which did not work for me:
Question#1: Accepted answer is to simply combine both JAR files using the JAR tool in java. It did not work for me, I get a NoClassDefFound error when trying to access any class inside ThirdPartyJar.jar. I export my Native Jar from Eclipse like this:
My doubt here is, in combining the two JARs where did I define the dependency? How is a simple combination of JARs working for others who have accepted the answer?
Question#2 : The accepted answer here talks about creating a platform options XML which defines the said 'packaged dependency'. Seems more logical. I tried to create it, as visible in my folder structure above and the adt command I am using. Here's how the 'platform.xml' looks:
<platform xmlns="http://ns.adobe.com/air/extension/4.0">
<packagedDependencies>
<packagedDependency>ThirdPartyJar.jar</packagedDependency>
</packagedDependencies>
<packagedResources>
</packagedResources>
</platform>
At first, I was getting an 'Namespace should be same as extension.xml' error while trying to build the ANE, but after I changed both of them to '...../4.0' I could build the ANE without any errors. However, when I included the ANE in my Flex Project, and tried to Run As > Mobile Application, it would give me this error:
I would then rename the strings.xml file in my Android Native Project, re-build the ANE, to get this error:
How do I get it to work? Between these two solutions I have tried myriad ways to package the two JARs together but it just would not work!