Error when linking libnative_camera_r2.2.0.so - QT + OpenCV4Android
-
Hi,
I've been trying to run OpenCV4Android 2.4.8 along with QT 5.2 to create an android app, but I got stuck with the following error when deploying the app:
@/dalvikvm(16441): dlopen("/data/app-lib/org.app-1/libnative_camera_r2.2.0.so") failed: Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol "_ZN7android6Camera17setPreviewDisplayERKNS_2spINS_8ISurfaceEEE" referenced by "libnative_camera_r2.2.0.so"...
W/System.err(16441): java.lang.reflect.InvocationTargetException
W/System.err(16441): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(16441): at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err(16441): at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:237)
W/System.err(16441): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:634)
W/System.err(16441): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:863)
W/System.err(16441): at android.app.Activity.performCreate(Activity.java:5165)
W/System.err(16441): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1103)
W/System.err(16441): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419)
W/System.err(16441): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)
W/System.err(16441): at android.app.ActivityThread.access$600(ActivityThread.java:162)
W/System.err(16441): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)
W/System.err(16441): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(16441): at android.os.Looper.loop(Looper.java:158)
W/System.err(16441): at android.app.ActivityThread.main(ActivityThread.java:5751)
W/System.err(16441): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(16441): at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err(16441): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
W/System.err(16441): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
W/System.err(16441): at dalvik.system.NativeStart.main(Native Method)
W/System.err(16441): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol "_ZN7android6Camera17setPreviewDisplayERKNS_2spINS_8ISurfaceEEE" referenced by "libnative_camera_r2.2.0.so"...
W/System.err(16441): at java.lang.Runtime.load(Runtime.java:340)
W/System.err(16441): at java.lang.System.load(System.java:521)
W/System.err(16441): at org.qtproject.qt5.android.QtNative.loadBundledLibraries(QtNative.java:150)
W/System.err(16441): at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:410)
W/System.err(16441): ... 19 more@My .pro file looks like the following:
@# Add more folders to ship with the application, here
folder_01.source = qml/app
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =
The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
OpenCv Configuration
#INCLUDEPATH += /usr/include/opencv
#INCLUDEPATH += /usr/include/opencv2
#INCLUDEPATH += /usr/include
#INCLUDEPATH += /usr/include/opencv2/coreANDROID_OPENCV = /home/valorcurse/Qt/android/opencv
LIBS +=
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_calib3d.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_flann.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_objdetect.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_contrib.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_video.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_ml.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_legacy.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_highgui.a
$$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibjpeg.a
$$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibpng.a
$$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibtiff.a
$$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibjasper.a
$$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/libzlib.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_ts.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_imgproc.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_core.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_androidcamera.a
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_features2d.aINCLUDEPATH += $$ANDROID_OPENCV/jni/include/opencv
INCLUDEPATH += $$ANDROID_OPENCV/jni/include/opencv2
INCLUDEPATH += $$ANDROID_OPENCV/jni/include/ANDROID_EXTRA_LIBS += $$files($$ANDROID_OPENCV/libs/armeabi-v7a/*.so) # Tried including all libs with the app
Installation path
target.path =
Please do not modify the following two lines. Required for deployment.
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
qtcAddDeployment()INCLUDEPATH += $$PWD/../build-app-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Debug
DEPENDPATH += $$PWD/../build-app-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-DebugANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
OTHER_FILES +=
android/AndroidManifest.xml@Any idea what I might be doing wrong?