2017-03-10 80 views
3

我在嘗試運行OpenCV樣本進行人臉檢測時出現此錯誤。我已經設置了Android SDK路徑和NDK路徑。 android.mk文件和Application.mk文件也被設置。我不明白爲什麼我得到這個錯誤。請幫忙。java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader [DexPathList .....]找不到「libdetection_based_tracker.so」

Android.mk

LOCAL_PATH := $(call my-dir) 

    include $(CLEAR_VARS) 

    #OPENCV_CAMERA_MODULES:=off 
    #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 C:/Users/m/Downloads/opencv-3.2.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk 
endif 

LOCAL_MODULE  := detection_based_tracker 
LOCAL_SRC_FILES := DetectionBasedTracker_jni.cpp 
LOCAL_C_INCLUDES += $(LOCAL_PATH) 
LOCAL_LDLIBS  += -llog -ldl 

include $(BUILD_SHARED_LIBRARY) 

Application.mk

APP_STL := gnustl_static 
APP_CPPFLAGS := -frtti -fexceptions 
APP_ABI := armeabi-v7a 
APP_PLATFORM := android-25 

Local.properties

ndk.dir=C\:\\Users\\m\\Documents\\android-ndk-r13b-windows-x86_64\\android-ndk-r13b 
sdk.dir=C\:\\Users\\m\\AppData\\Local\\Android\\sdk1 

Project structure

回答

4

確保此塊在openCVSam存在plefacedetection的build.gradle文件:

externalNativeBuild { 
    ndkBuild { 
     path 'src/main/jni/Android.mk' 
    } 
} 

此外,請確保您有PATH到你的Android NDK導出到環境變量。

+0

非常感謝。這工作。 – MJ123

+0

很高興聽到!如果我的回答滿足這個問題,請標記爲已接受的答案。 ;) – CzarMatt

相關問題