[External Shared Lib in QtAndroid]

Ederson de Moura ederbsd at gmail.com
Fri Aug 5 19:57:43 UTC 2011


Hello all!

Porting applications and libraries Maemo-5 to Android.

My application depends on an "external library", also written in C++
and Qt compiled in "shared lib" Android by QtCreator/Necessitas.

Now the application in use at the AVD Android! I am not able to load
the shared library. The application simply does not open is locked!!!

I tried the following below:

1) In file project ".pro" the application, added the line:

...
LIBS += -L /home/edm/app/lib -l geodroid
...

2) The lib was copied to the directory: android/libs/armeabi/libgeodroid.so

3) The tag was added in file libs.xml "bundled_libs"

<?xml version='1.0' encoding='utf-8'?>
<resources>
    <array name="qt_libs">
        <item>QtCore</item>
        <item>QtGui</item>
    </array>
    <array name="bundled_libs">
        <item>libgeodroid</item>
    </array>
</resources>

4) The package ".APK" created. Check:

% unzip -l App-debug.apk
Archive:  App-debug.apk
  Length      Date    Time    Name
---------  ---------- -----   ----
     2904  2011-08-05 14:34   AndroidManifest.xml
     1320  2011-08-05 14:34   resources.arsc
     3966  2011-08-05 14:34   res/drawable-hdpi/icon.png
     1537  2011-08-05 14:34   res/drawable-ldpi/icon.png
     2200  2011-08-05 14:34   res/drawable-mdpi/icon.png
    99444  2011-08-05 14:34   classes.dex
    26752  2011-08-04 17:42   lib/armeabi/libapp.so
   260680  2011-08-04 17:42   lib/armeabi/gdbserver
     6520  2011-08-05 14:32   lib/armeabi/libgeodroid.so
<----------------------- [LIB HERE! NICE]
      721  2011-08-05 14:34   META-INF/MANIFEST.MF
      774  2011-08-05 14:34   META-INF/CERT.SF
      776  2011-08-05 14:34   META-INF/CERT.RSA
---------                     -------
   407594                     12 files

5) Ok! file APK installed on the AVD! But the application does not
open on Android???
Force close application.

Tests:

% file libgeodroid.so
libgeodroid.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV),
dynamically linked, not stripped

In AVD Shell:

# pwd
/data/data/eu.licentia.necessitas.industrius.example.app/lib

# strace ./libgeodroid.so
execve("./libgeodroid.so", ["./libgeodroid.so"], [/* 11 vars */]) = 0
syscall: unknown syscall trap 0x00000062

# strace ./libapp.so
execve("./libapp.so", ["./libapp.so"], [/* 11 vars */]) = 0
syscall: unknown syscall trap 0xe5bcf12c

What can I be doing wrong? I found some threads on this list, but no solution.

Some hope for it???

-----------------------------------------------------------------------------
Versions: necessitas-0.2.1-online-sdk-installer-linux - 2011-06-25 - 23.0 MB

Qt Creator 2.2.0
Based on Qt 4.7.3 (32 bit)
Built on May 25 2011 at 16:18:43

Android emulator avd: target-8
Ministro 2.0

Linux kubuntu 32 Bits 11.04
-----------------------------------------------------------------------------

Best regards,

EDM.

-- 
Ederson de Moura
http://sites.google.com/site/edersondemoura/


More information about the Necessitas-devel mailing list