[Android-development] Integrating Dropbox

Harri Pasanen harri at mpaja.com
Fri Sep 26 17:41:15 CEST 2014


On 25/09/2014 15:20, Stromme Christian wrote:
> On 25 Sep 2014, at 08:48 , Harri Pasanen <harri at mpaja.com> wrote:
>
>> On 24/09/2014 19:57, Harri Pasanen wrote:
>>> Hi,
>>>
>>> Trying to include official DropBox Android SDK libs in my Qt project,
>>> I ran into an issue where the app crashes at startup.
>>>
>>> Logcat provides a hint:
>>>
>>> W/dalvikvm(22608): No implementation found for native
>>> Lcom/dropbox/sync/android/NativeLib;.nativeLibIsLoaded:()Z
>>>
>>> shortly after uncaught exceptions cause it to crash and come burning
>>> down.
>>>
>>> I think what is happening is that the DropBox java API is trying to
>>> reload the libDropboxSync.so which is already loaded by Qt as it is
>>> part of the
>>> bundled_libs in libs.xml.  It is not prepared for the fact that the
>>> lib is already loaded.
>>>
>>> Is there some qmake magic or other voodoo that would bundle a lib in
>>> APK's library folder, but would prevent Qt from loading it?
>>>
>>> Like a variable that would blacklist the libraries not to be loaded by
>>> Qt at startup?
>>>
>>> Thanks,
>>>
>>> Harri
>> Curiosity got the better of me and I went rummaging around the Qt source.
>>
>> I hope to be wrong, but I don't think my case above has been thought of
>> yet.  Seems like one possible place to hack would be around
>> the function public static void loadBundledLibraries() in QtNative.java.
>> Better solution would be to have a a second category of bundled libs:
>> bundled yes, but not so much as automatically loaded.
>>
>> Any hints appreciated,
>>
>> Harri
>>
>>
>>
>> _______________________________________________
>> Android-development mailing list
>> Android-development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/android-development
>
> Hi,
>
> I don’t know how the DropBox implementation is done, but I would be very surprised if it fails due
> to a library reload… Can you confirm that the appropriate dropbox libraries are loaded by Qt?
> Also, Qt only loads libraries you tell it to load (see ANDROID_EXTRA_LIBS in your .pro file)

It seems it has something to with deploying to local directory, so 
related to my other post.
When deployed to bundle it works, but when not, I get this:

W/dalvikvm(11071): Shared lib 
'/data/app-lib/com.mpaja.mbraille2-1/libDropboxSync.so' already opened 
by CL 0x41f25df0; can't open in 0x41f035d0

and subsequently things die on Nexus 7.

Somewhat surprisingly I can run from tmp lib deployment if I modify the 
QtNative.java code to read:

     public static void loadBundledLibraries(ArrayList<String> 
libraries, String nativeLibraryDir)
     {
         if (libraries == null)
             return;

         for (String libName : libraries) {
           if (!libName.equals("DropboxSync")) {

             try {
                 File f = new File(nativeLibraryDir+"lib"+libName+".so");
                 if (f.exists())
                     System.load(f.getAbsolutePath());


It only works on Nexus 7 though, the presumably stricter security policy 
of Samsung S4 mini kills it before as
I reported in another mail.

Harri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20140926/752963e4/attachment.html>


More information about the Android-development mailing list