Android NDK build error: LOCAL_SRC_FILES points to a missing file
Asked Answered
F

0

1

I am using this question accepted answer to build nonfree module of opencv 2.4.11. i am using windows 10 operating system.

1) I moved nonfree folder from OpenCV 2.4.11\sources\modules\nonfree\
include\opencv2\ to OpenCV-2.4.11-android-sdk\sdk\native\jni\include\opencv2

2) I have created the libnonfree folder and the jni folder inside the libnonfree folder. The nonfree_init.cpp, precomp.hpp, sift.cpp and surf.cpp files are in the jni folder.

3) I have also created the Android.mk and Application.mk script files.

4) Time to build the libnonfree.so change the cmd directory into the libnonfree and type ndk-build

Here is the complete error message.

Android NDK: ERROR:Android.mk:opencv_java: LOCAL_SRC_FILES points to a missing file Android NDK: Check that C:/Users/what/Desktop/OpenCV-android-sdk-build/sdk/native/jni/../libs/arm64-v8a/libopencv_java.so exists or that its path is correct C:/Users/what/AppData/Local/Android/sdk1/ndk-bundle/build//../build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.

Here is also screenshot of my files and folders

Please help i have been stuck for to days to solve this problem.

Fachan answered 18/3, 2017 at 12:22 Comment(10)
Most likely your mistake was to build a 64-bit library, while your OpenCV dependency was only built for 32-bit ARM. Try to run ndk-build APP_ABI=armeabi-v7aLavern
@AlexCohn I am using APP_ABI := armeabi-v7a in the Application.mk file.Fachan
But your error message suggests that ndk-build is looking for arm64 library. Maybe it ignores Application.mk or there is some typo there. Please do me a favour, choose ABI on command lineLavern
Please run ndk-build V=1 and post the complete build logLavern
Right. Sorry I got distracted. Have you tried APP_ABI on command line?Lavern
Thanks i have solved my problem using the ndk-build APP_ABI := armeabi-v7aFachan
Are you using externalNativeBuild via gradle? That will ignore your APP_ABI setting, so you need to use abiFilters instead.Rickrack
No, the output should go to libnofree/libs/armeabi-v7a. Two files shoul be there: libopencv_java.so and your libnofree.soLavern
It don't why but they are created in the ndk directory path libs\armeabi-v7aFachan
probably your Application.mk is wrong; also, if (as @DanAlbert commented above) you run an integrated ndk-build in Android Studio, it will override the build arguments and the destination. BTW, I notice something suspicious in your setup: Application.mk and Android.mk should be inside the jni directory, not above it!Lavern

© 2022 - 2024 — McMap. All rights reserved.