Misconfiguration for Android 4.1 and platform plugin android-8?

Alex Leutgöb privat at alexleutgoeb.com
Wed Oct 3 10:45:01 UTC 2012


Hi all,

I usually build my Necessitas-based apps using the libraries from the installer and linking them by myself. Due to compatibility reasons I use the platform plugin android(GL)-8. There was no problem at all till updating my Nexus 7 to Android 4.1.1 (also verified this with a Galaxy Nexus 4.1.1). Since then my apps crash on startup while "trying to load lib libandroid-8.so" with the message:

10-03 12:13:29.525: E/AndroidRuntime(2523): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]:   124 cannot locate '_ZN7android12AssetManager7openDirEPKc'...

So I did a bit of investigation regarding this symbol in the different Android versions.

Using nm and looking for the missing symbol within the pre-installed libraries:


v2.3 (Galaxy Ace / Huawei Ascend G300):
#################################

libandroid.so
         U _ZN7android12AssetManager7openDirEPKc
libandroid_runtime.so
         U _ZN7android12AssetManager7openDirEPKc
libutils.so
000131f4 T _ZN7android12AssetManager7openDirEPKc


v4.0.3 (Emulator):
##############

libandroid.so
         U _ZN7android12AssetManager7openDirEPKc
libandroid_runtime.so
         U _ZN7android12AssetManager7openDirEPKc
libutils.so
000161f4 T _ZN7android12AssetManager7openDirEPKc


4.1 (Nexus 7):
###########

libandroid.so
         U _ZN7android12AssetManager7openDirEPKc
libandroid_runtime.so
         U _ZN7android12AssetManager7openDirEPKc
libandroidfw.so
00018490 T _ZN7android12AssetManager7openDirEPKc


So from my understanding "U" (undefined) means that the library links to this symbol, it's however not included in the lib; "T" means an entry in the (textual) symbol table, meaning it is included. As we can see the symbol moved from libutils to libandroidfw in 4.1, reading information from the "android-8.pro" the library only links to libutils ("-lutils").

If I'm using android-9 everything is working (android-9 is linking against "-landroid" not "-lutils"), so I also used read-elf to check symbol visibility between the installer shipped platform plugins:

libandroid-8.so
0xcd9c <AAssetManager_openDir>: @0x4cad8
4880: 0000cd9d    48 FUNC    LOCAL  HIDDEN     8 AAssetManager_openDir

libandroid-9.so
00067e18  00017716 R_ARM_JUMP_SLOT   00000000   AAssetManager_openDir
375: 00000000     0 FUNC    GLOBAL DEFAULT  UND AAssetManager_openDir
923: 00000000     0 FUNC    GLOBAL DEFAULT  UND AAssetManager_openDir

Telling me that the symbol is hidden in android-8 (although there exists an "asset_manager.cpp" file in android-8 sources.


So to recap (sorry for the long explanation!), it would be of interest if someone of you guys can reproduce the linker error at runtime (android-8 on Android 4.1). Is this probably a misconfiguration of the current platform plugin? Do we need to link android-8 against android.so (like android-9 does) too?

Many thanks,
Alex




More information about the Necessitas-devel mailing list