1

I am working on OpenCV with Android. And I tried run Face detection sample. But I always get same error please help.

Build command failed. Error while executing process C:\Users\Cevdet\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Cevdet\AndroidStudioProjects\face-detection\openCVSamplefacedetection\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Cevdet\AndroidStudioProjects\face-detection\openCVSamplefacedetection\src\main\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=C:/Users/Cevdet/AndroidStudioProjects/face-detection/openCVSamplefacedetection/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\Cevdet\AndroidStudioProjects\face-detection\openCVSamplefacedetection\build\intermediates\ndkBuild\debug\lib C:/Users/Cevdet/AndroidStudioProjects/face-detection/openCVSamplefacedetection/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libdetection_based_tracker.so} [armeabi-v7a] SharedLibrary : libdetection_based_tracker.so C:/Users/Cevdet/AndroidStudioProjects/face-detection/openCVSamplefacedetection/src/main/jni/DetectionBasedTracker_jni.cpp:34: error: undefined reference to 'DetectionBasedTracker::DetectionBasedTracker(std::__ndk1::basic_string, std::__ndk1::allocator > const&, DetectionBasedTracker::Parameters const&)' clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [C:/Users/Cevdet/AndroidStudioProjects/face-detection/openCVSamplefacedetection/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libdetection_based_tracker.so] Error 1

javaDeveloper
  • 1,403
  • 3
  • 28
  • 42
Cevdet
  • 69
  • 9
  • The error is not `NDK_PROJECT_PATH=null` (see [this answer](https://stackoverflow.com/a/50707270/1524450)), it's `undefined reference to 'DetectionBasedTracker::DetectionBasedTracker(std::__ndk1::basic_string, std::__ndk1::allocator > const&, DetectionBasedTracker::Parameters const&)' ` – Michael Oct 30 '18 at 11:26

1 Answers1

0

You need to setup OpenCV librairies for your project.

You can follow the instruction here-->https://stackoverflow.com/a/22427267/5773037

Nikunj Paradva
  • 15,332
  • 5
  • 54
  • 65
  • Thanks for reply. I followed the instruction but I got different error. Like this ; Unable to resolve dependency for ':openCVSamplefacedetection@debug/compileClasspath': Could not resolve project :libraries:opencv. – Cevdet Oct 30 '18 at 11:32
  • @Cevdet check your internet connectivity may b it ll be affect – Nikunj Paradva Oct 30 '18 at 11:35
  • It's not about Internet. I clicked the "Make project " button. This is new error .s "Unable to find a matching configuration of project :libraries:opencv: None of the consumable configurations have attributes." – Cevdet Oct 30 '18 at 11:40