Android app works on 4.3 and above only [closed]

asked 2014-09-16 14:02:57 -0500

sumitsrv gravatar image

updated 2014-09-16 15:09:24 -0500

Hi,

I have an OpenCV Android app (Qt based). It works for versions 4.3 and above but fails for others. The specific error being it is not able to find the libraries libopencv_java.so and libopencv_info.so, though the same APK works on the specified versions. I have already specified the min sdk as 14 and target sdk as "not set" in AndroidManifest.xml. Also the NDK points to platform 16 (Android 4.0.3). Not sure what's creating this problem.

Attaching stacktrace,

Starting remote process.D/dalvikvm(  884): Not late-enabling CheckJNI (already on)
E/Trace   (  884): error opening trace file: No such file or directory (2)
D/dalvikvm(  884): GC_CONCURRENT freed 210K, 10% free 5467K/6023K, paused 16ms+3ms, total 78ms
D/dalvikvm(  884): GC_CONCURRENT freed 340K, 12% free 5526K/6215K, paused 14ms+3ms, total 61ms
D/dalvikvm(  884): GC_CONCURRENT freed 395K, 12% free 5539K/6279K, paused 15ms+40ms, total 129ms
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libgnustl_shared.so 0x40f7a6e0
D/dalvikvm(  884): Added shared lib /data/data/org.qtproject.example.TrackerDemo/lib/libgnustl_shared.so 0x40f7a6e0
D/dalvikvm(  884): No JNI_OnLoad found in /data/data/org.qtproject.example.TrackerDemo/lib/libgnustl_shared.so 0x40f7a6e0, skipping init
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Core.so 0x40f7a6e0
D/dalvikvm(  884): Added shared lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Core.so 0x40f7a6e0
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Network.so 0x40f7a6e0
D/dalvikvm(  884): Added shared lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Network.so 0x40f7a6e0
I/Qt      (  884): Network start
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Qml.so 0x40f7a6e0
D/dalvikvm(  884): Added shared lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Qml.so 0x40f7a6e0
D/dalvikvm(  884): No JNI_OnLoad found in /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Qml.so 0x40f7a6e0, skipping init
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Gui.so 0x40f7a6e0
D/dalvikvm(  884): Added shared lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Gui.so 0x40f7a6e0
D/dalvikvm(  884): No JNI_OnLoad found in /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Gui.so 0x40f7a6e0, skipping init
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Quick.so 0x40f7a6e0
D/dalvikvm(  884): Added shared lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Quick.so 0x40f7a6e0
D/dalvikvm(  884): No JNI_OnLoad found in /data/data/org.qtproject.example.TrackerDemo/lib/libQt5Quick.so 0x40f7a6e0, skipping init
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5QuickParticles.so 0x40f7a6e0
D/dalvikvm(  884): Added shared lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5QuickParticles.so 0x40f7a6e0
D/dalvikvm(  884): No JNI_OnLoad found in /data/data/org.qtproject.example.TrackerDemo/lib/libQt5QuickParticles.so 0x40f7a6e0, skipping init
D/dalvikvm(  884): Trying to load lib /data/data/org.qtproject.example.TrackerDemo/lib/libQt5XmlPatterns ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-09-22 16:44:32.043901

Comments

Posting as comment since I do not use Qt. (This comment is based on information from internet search only. Use at own risk.) According to androiddeployqt page,, any non-Java binary files (.so files) need to be specified in ANDROID_EXTRA_LIBS in order for them to be copied into the application package.

rwong gravatar imagerwong ( 2014-09-16 22:04:13 -0500 )edit

rwong: Makes sense. Will try and get back with updates.

sumitsrv gravatar imagesumitsrv ( 2014-09-17 01:49:15 -0500 )edit

rwong: Unfortunately, when I specify the libs as part of ANDROID_EXTRA_LIBS rather than LIBS, Qt build fails (its now not able to locate the libraries to build)

sumitsrv gravatar imagesumitsrv ( 2014-09-17 02:57:47 -0500 )edit
1

rwong: Actually this helped. Need to specify LIBS and ANDROID_EXTRA_LIBS as well. Will update the answer myself.

sumitsrv gravatar imagesumitsrv ( 2014-09-17 03:35:55 -0500 )edit