Hello!
I have an ANE that contains a shared library with C/C++ code, which is accessed from the Java side of the extension via JNI. When I use ADT to include the ANE in an APK package, the shared library is missing from the APK package if ADT target is apk-captive-runtime. Consequently, any Java methods marked as native are broken because their C/C++ implementations can't be found. (Specifically, when the Java side of the extension attempts to load the shared library by calling System.loadLibrary(), an UnsatisfiedLinkError exception is thrown.)
Incidentally, the shared libraries are correctly included in the APK package if ADT target is apk or apk-debug. The bug only occurs when ADT target is apk-captive-runtime, so I suspect there's nothing wrong with the ANE itself.
The ANE is structured as follows:
MyANE | catalog.xml | library.swf | mimetype | \---META-INF \---ANE | extension.xml | \---Android-ARM | library.swf | MyANE.jar | \---libs \---armeabi-v7a libMyANE.so |
Below is the call to package the APK from ADT:
| adt -package -target apk-captive-runtime -storetype pkcs12 -keystore "cert\ANETest.p12" -storepass fd "dist\ANETest-captive-runtime.apk" "application.xml" -C bin . -C "icons/android" . -extdir lib |
Has anyone else experienced this issue? Is this a bug with ADT, and if so, are there any workarounds?
Thanks!
EDIT: The problem occurs with AIR 3.8 and 3.9.