Skip to main content
November 1, 2011
Question

ADT Packaging APK With Native .so Libs

  • November 1, 2011
  • 2 replies
  • 2894 views

Greetings,

I have 2 native libararies (.so) which I need to include in an apk.  It appears that they MUST exist in the following 2 directories:

myAPK

/lib

/armeabi

/armeabi-v7a

My team has spent probably 72 hours ellapsed trying to figure out how to do this and we have yet to find a solution.  Thus far we have tried:

  1. Extracting an .apk archive, manually inserting the above /lib directory as needed, re-zipping the .apk, and then re-signing the apk
    • This approach was haulted by the fact that no matter what we did in terms of signing, when trying to run the APK on a device, logcat informed us that there were no certificates present.  This is almost certainly untrue, but it suggests that we simply do not understand the complexities of re-signing a previously signed APK after we have manually altered it.
  2. Including the /lib directory when calling the ADT packager
    • This call successfully included the /lib directory, but the /lib directory was located within the APK's /assets directory like all of the other AIR files.  This seems to prevent the Android loader from locating the native libraries.

A permanent solution to this problem would be great, but at this point I will even thank someone for a completely hacked solution because this impediment has crippled our entire project's foreword progress.

Thanks.

Matt

This topic has been closed for replies.

2 replies

Participating Frequently
November 3, 2011

Hi,

Does the section "Including additional Android shared libraries in the ANE package" in this doc help? http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2482335412ffea65006-8000.html#WSf268776665d7970d-6be13ace1308aaebeca-7fff

Here is the sample package script snippet for your reference:

echo "****** ANE *******"

unzip -o ./source/$NESWC/bin/$NESWCNAME.swc -d ./Source_ANE/Android-ARM

$AIRSDK/adt -package \

    -storetype PKCS12 \

          -keystore ./$CERT \

          -storepass $CERTPASS \

          -target ane ./Source_APK/$EXTID.ane \

          ./source/$NESWC/src/extension.xml \

          -swc ./source/$NESWC/bin/$NESWCNAME.swc \

          -platform Android-ARM \

          -C ./Source_ANE/Android-ARM/ \

          .

echo "****** APK *******"

cp ./source/$NEAPP/bin-debug/$NEAPPNAME.swf ./Source_APK

cp ./source/$NEAPP/bin-debug/$NEAPPNAME-app.xml ./Source_APK

cd ./Source_APK

$AIRSDK/adt -package \

    -XnoAneValidate \

          -target apk \

          -storetype PKCS12 \

          -keystore ../$CERT \

          -storepass $CERTPASS \

          ../$NEAPK.apk \

          ./$NEAPPNAME-app.xml \

          ./$NEAPPNAME.swf \

          -extdir .

Thanks,

Jian

Adobe Flash Runtime team

Participant
September 14, 2012

Using System.loadLibrary() from within my jar native extension I have succussfully loaded some .so libraries. But logcat continues to report it cannot resolve any of the static methods from any of the libraries? Not sure what I'm doing wrong? Feels like the jar has no permission, access or knowledge of the loaded libraries.