Android Studio:OpenCv:Face-detection = java.lang.UnsatisfiedLinkError: Couldn't load detection_based_tracker from loader dalvik.system.PathClassLoader -
java.lang.unsatisfiedlinkerror: couldn't load detection_based_tracker 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 have 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 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 lines dont have libs directory under main directory:
sourcesets.main { jnilibs.srcdir 'src/main/libs' jni.srcdirs = [] }
also there 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 run face-detection project opencv? should add in build.gradle?
Comments
Post a Comment