Remember the former compiled so library directly using Ndk-build, today using the error is as follows:
notdirectory ! thevariabletotoit. /opt/android-ndk-r10b/build/core/build-local.mk:148: *** Android NDK: Aborting . Stop.
An expert's weapon is as follows:
You need toSpecify3Things. Ndk_project_path- theLocation ofYour PROJECTNDK_APPLICATION_MK- thePath of theApplication.mkfileApp_build_script- thePath to theAndroid.mkfileThese is needed toOverride theDefault values of theBuild script, which expects things toBeinch theJnifolder. When calling Ndk-build Usendk-build ndk_project_path=/path/ to/proj ndk_application_mk=/path/ to/application.mkin application.mkAddApp_build_script: =/path/ to/android.mk
First step, add android.mk path in application
For example, these two files are siblings:
APP_BUILD_SCRIPT := Android.mk
The second step is to compile directly:
$ Ndk-buildNdk_project_path=.NDK_APPLICATION_MK=Application. mk[armeabi-v7a]Compile++Thumb:Detection_and_recognition_lib <=detectionandrecognition. cpp[armeabi-v7a]prebuilt :Libopencv_java.so <=/home/linc/workspace/lab/OPENCV-ANDROID-SDK-2.4.11/SDK/native/jni/.. /libs/armeabi-v7a/[ARMEABI-V7A]sharedlibrary :libdetection_and_recognition_lib.so/opt/android-ndk-r10b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/. /lib/gcc/arm-linux-androideabi/4.6/.. /.. /.. /.. /arm-linux-androideabi/bin/LD: Warning:Hidden symbol' __aeabi_atexit ' inch/opt/android-ndk-r10b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/thumb/LIBGNUSTL_STATIC.A (ATEXIT_ARM.O) is referenced by DSO./obj/local/armeabi-V7A/LIBOPENCV_JAVA.SO[ARMEABI-V7A]Install :libdetection_and_recognition_lib.so = libs/armeabi-v7a/libdetection_and_recognition_lib.so[armeabi-v7a]prebuilt :Libnative_camera_r4.3.0. So <=/home/linc/workspace/lab/OPENCV-ANDROID-SDK-2.4.11/SDK/native/jni/.. /libs/armeabi-v7a/[ARMEABI-V7A]Install :Libnative_camera_r4.3.0. so = Libs/armeabi-v7a/libnative_camera_r4.3.0. so[armeabi-v7a]prebuilt :Libnative_camera_r4.4.0. So <=/home/linc/workspace/lab/OPENCV-ANDROID-SDK-2.4.11/SDK/native/jni/.. /libs/armeabi-v7a/[ARMEABI-V7A]Install :Libnative_camera_r4.4.0. so = Libs/armeabi-v7a/libnative_camera_r4.4.0. so[armeabi-v7a]Install :libopencv_java.so = libs/armeabi-v7a/libopencv_java.so[x86]Compile++:Detection_and_recognition_lib <=detectionandrecognition. cpp[x86]prebuilt :Libopencv_java.so <=/home/linc/workspace/lab/OPENCV-ANDROID-SDK-2.4.11/SDK/native/jni/.. /libs/x86/[x86]sharedlibrary :Libdetection_and_recognition_lib.so[x86]Install :libdetection_and_recognition_lib.so = libs/x86/libdetection_and_recognition_lib.so[x86]prebuilt :Libnative_camera_r4.3.0. So <=/home/linc/workspace/lab/OPENCV-ANDROID-SDK-2.4.11/SDK/native/jni/.. /libs/x86/[x86]Install :Libnative_camera_r4.3.0. so = Libs/x86/libnative_camera_r4.3.0. so[x86]prebuilt :Libnative_camera_r4.4.0. So <=/home/linc/workspace/lab/OPENCV-ANDROID-SDK-2.4.11/SDK/native/jni/.. /libs/x86/[x86]Install :Libnative_camera_r4.4.0. so = Libs/x86/libnative_camera_r4.4.0. so[x86]Install :libopencv_java.so = libs/x86/libopencv_java.so
You may have seen the prawns, I am compiling OPENCV related projects. Now the device selection has covered the x86 architecture, so compile to choose x86 instruction set compilation. The following are noted in the APPLICATION.MK:
APP_ABI := armeabi-v7a x86
Reference:
Http://stackoverflow.com/questions/14156596/ndk-cant-find-the-application-directory
Android Problem Collection 40: Android Ndk:could not find application project directory