Hi,
I am trying to build an App using OpenCV and NDK. The app works fine on my Nexus 5 but when I try it on my Samsung Galaxy S6 I get a message that OpenCV could not be initialized correctly and on the logcat I get the error
E/art(3895): dlopen("/data/app/org.opencv.engine-1/lib/arm64/libopencv_java3.so", RTLD_LAZY) failed: dlopen failed: "/data/app/org.opencv.engine-1/lib/arm64/libopencv_java3.so" is 64-bit instead of 32-bit
Browsing through StackOverflow I figured that this error could be resolved including the library in the apk. So I tried including opencv placing
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on
in the Android.mk and loading OpenCV with:
static {
if (!OpenCVLoader.initDebug()) {
// Handle initialization error
}
}
like stated in the opencv tutorial page
but I couldn't get it to load OpenCV.
Here is my Android.mk and Application.mk
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on
include /Users/ben/Downloads/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := native gray
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS += -llog -ldl
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
include $(BUILD_SHARED_LIBRARY)
Application.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-9
Thank you ;)