[External Shared Lib in QtAndroid]

Niko Sams niko.sams at gmail.com
Thu Aug 18 05:36:35 UTC 2011


I think I had the same problem, see this thread for a patch:
http://mail.kde.org/pipermail/necessitas-devel/2011-June/000087.html

afaik it's not yet integrated because it was not a clean solution.

Niko

On Wed, Aug 17, 2011 at 17:53, Ederson de Moura <ederbsd at gmail.com> wrote:
> Hi!
>
> Resgisters is the "logcat" only. My temporary solution: Copy to my lib
> folder of the same template library in the qt android:
>
> % adb push libgeodroid.so
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/
>
> So it worked! possibly patch!!!
>
> Using the necessitas when you add the tag "bundled_libs" with the
> library, and recompile the application to tag "bundled_libs" is erased
> by the necessitas.
>
> So I have to manually re-add and run: "ant debug"
>
> Part of the application now running log:
>
> # logcat
> D/dalvikvm(  390): Trying to load lib
> /data/data/eu.licentia.necessitas.ministro/lib/libchmode.so 0x40512878
> D/dalvikvm(  390): Added shared lib
> /data/data/eu.licentia.necessitas.ministro/lib/libchmode.so 0x40512878
> D/dalvikvm(  390): No JNI_OnLoad found in
> /data/data/eu.licentia.necessitas.ministro/lib/libchmode.so
> 0x40512878, skipping init
> D/dalvikvm(  127): GC_EXPLICIT freed 119K, 50% free 2984K/5895K,
> external 5907K/5928K, paused 1524ms
> D/dalvikvm(  382): Trying to load lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libQtCore.so
> 0x405156d0
> D/dalvikvm(  382): Added shared lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libQtCore.so
> 0x405156d0
> D/dalvikvm(  382): No JNI_OnLoad found in
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libQtCore.so
> 0x405156d0, skipping init
> D/dalvikvm(  382): Trying to load lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libQtGui.so
> 0x405156d0
> D/dalvikvm(  382): Added shared lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libQtGui.so
> 0x405156d0
> D/dalvikvm(  382): No JNI_OnLoad found in
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libQtGui.so
> 0x405156d0, skipping init
> D/dalvikvm(  382): Trying to load lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/plugins/platforms/android/libandroid-8.so
> 0x405156d0
> D/dalvikvm(  382): Added shared lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/plugins/platforms/android/libandroid-8.so
> 0x405156d0
> D/dalvikvm(  382): Trying to load lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libgeodroid.so
> 0x405156d0
> D/dalvikvm(  382): Added shared lib
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libgeodroid.so
> 0x405156d0
> D/dalvikvm(  382): No JNI_OnLoad found in
> /data/data/eu.licentia.necessitas.ministro/files/qt/lib/libgeodroid.so
> 0x405156d0, skipping init
> I/Qt      (  382): qt start
> D/dalvikvm(  382): Trying to load lib
> /data/data/eu.licentia.necessitas.industrius.example.gigfer/lib/libgigfer.so
> 0x405156d0
> D/dalvikvm(  382): Added shared lib
> /data/data/eu.licentia.necessitas.industrius.example.gigfer/lib/libgigfer.so
> 0x405156d0
> ...
>
> This way is working but not an elegant solution!
>
> Cheers,
>
> EDM.
>
>
> On Tue, Aug 16, 2011 at 5:53 AM, BogDan <bog_dan_ro at yahoo.com> wrote:
>> Hi,
>> Please also provide the log when you run your application.
>> Cheers,
>> BogDan.
>>
>> ________________________________
>> From: Ederson de Moura <ederbsd at gmail.com>
>> To: necessitas-devel at kde.org
>> Sent: Friday, August 5, 2011 10:57 PM
>> Subject: [External Shared Lib in QtAndroid]
>>
>> 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/
>> _______________________________________________
>> Necessitas-devel mailing list
>> Necessitas-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/necessitas-devel
>>
>>
>>
>
>
>
> --
> Ederson de Moura
> http://sites.google.com/site/edersondemoura/
> _______________________________________________
> Necessitas-devel mailing list
> Necessitas-devel at kde.org
> https://mail.kde.org/mailman/listinfo/necessitas-devel
>


More information about the Necessitas-devel mailing list