Skip to main content
Participating Frequently
December 16, 2013
Question

Has anyone experience missing annotations at runtime on the Android platform via a native extension?

  • December 16, 2013
  • 1 reply
  • 3619 views

Hi all,

I am building a native extension for the Android platform that is exhibiting a problem where annotations used by a 3rd party dependency JAR (CRest) within the native extension are not being found at runtime.   This causes a crash when the annotations are validated.

As a bit of background, the native extension is simply a wrapper for an existing custom JAR along with it's dependency JAR's - these are merged into a single JAR required for the extension build process.  When the merged JAR is used in a standard Android applicaiton it works as expected at runtime so this problem only appears to be when using the JAR via the Adobe AIR runtime on Android.

It took quite a while to work out the exact problem due to it being such a strange runtime error, but once I had figured out the actual issue I tried a number of things to resolve the problem, including updating the AIR SDK to 3.9 (generally I've been using 3.7 to match the version used by our partner developers) and updating the version of Android used by the AIR SDK.  So far I've not had any luck and the only suggested solution I've been able to find regarding this is that the JAR needs adding to the runtime classpath, but I can't seem to find a way of explicitly doing this via Adobe Flash Builder.

Although quite a specific scenario, I was wondering if anyone else had come across this situation and knew of a fix or viable workaround?

Thanks,

Duane

This topic has been closed for replies.

1 reply

Nimisha1
Participating Frequently
December 16, 2013

Hi Duane,

If I am not wrong then you're trying to build a native extension which is using a third party jar. With AIR 4.0, a new feature is introduced "Support for native resources access by R* mechanism in native extension"  you can read more about it @http://labsdownload.adobe.com/pub/labs/flashruntimes/shared/air4-0_flashplayer12-0_releasenotes.pdf. This feature allows you to use the third party jar in your ANE project and all you have to do is to make your ANE project a library project and then have to include this third party jar in it, apart from that you have to provide platform.xml(where you can define the jar dependencies) while packaging the ANE(more details in release notes pdf).

Let me know if you have any queries.

Thanks,

Nimisha

Participating Frequently
December 16, 2013

Thanks Nimisha, that looks similar to the way the iOS dependency libraries are packaged for the ANE so perhaps that will resolve the problem and save me having to merge the JAR's together. 

I'll have a go at using the 4.0 beta AIR SDK and let you know if that works.