Skip to main content
Participant
November 15, 2013
Question

Trouble installing ANE containing shared libraries when ADT target is apk-captive-runtime

  • November 15, 2013
  • 1 reply
  • 935 views

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.

This topic has been closed for replies.

1 reply

Participant
December 2, 2013

It turns out that there is a workaround for this issue. By placing the shared library in the ANE's libs/armeabi folder rather than libs/armeabi-v7a, the shared library is correctly included in the APK package if the ADT target is apk-captive-runtime.

Note that the workaround is inconsistent with Adobe's ANE documentation: the documentation states that the APK package includes the libraries in libs/armeabi-v7a if the ADT target is apk or apk-captive-runtime; or the libraries in libs/armeabi if the ADT target is apk-emulator, apk-debug, or apk-profile.

Adobe Employee
December 3, 2013

Hi gmorchower,

This issue has now been fixed and should be available to you soon. Once you have a build with this issue fixed, you need not apply the workaround.

Thanks,
Daman