java.lang.UnsatisfiedLinkError: Couldn't load detection_based_tracker from
loader dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/org.opencv.samples.facedetect-9.apk"],nativeLibraryDirectories=
[/data/app-lib/org.opencv.samples.facedetect-9, /vendor/lib, /system/lib]]]:
findLibrary returned null
And I have also this error.
at.org.opencv.samples.facedetect.FdActivity$1.onManagerConnected(FdActivity.java:67)
Related rows:
66: // Load native library after(!) OpenCV initialization
67: System.loadLibrary("detection_based_tracker");
Gradle version: 2.14.1
Plugin version: 2.2.0 My build.gradle(app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "org.opencv.samples.facedetect"
minSdkVersion 8
targetSdkVersion 8
ndk {
moduleName "detection_based_tracker"
}
}
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = []
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dependencies {
compile project(':openCVLibrary300')
}
I added this lines but I dont have a libs directory under the main directory:
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = [] }
Also there is no *.so file.
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#OPENCV_INSTALL_MODULES:=off
#OPENCV_LIB_TYPE:=SHARED
ifdef OPENCV_ANDROID_SDK
ifneq ("","$(wildcard $(OPENCV_ANDROID_SDK)/OpenCV.mk)")
include ${OPENCV_ANDROID_SDK}/OpenCV.mk
else
include ${OPENCV_ANDROID_SDK}/sdk/native/jni/OpenCV.mk
endif
else
include ../../sdk/native/jni/OpenCV.mk
endif
LOCAL_SRC_FILES := DetectionBasedTracker_jni.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_LDLIBS += -llog -ldl
LOCAL_MODULE := detection_based_tracker
include $(BUILD_SHARED_LIBRARY)
Aplication.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-8
How can I run this face-detection project with opencv? What should I add in build.gradle?