When running the ndk-build command I get the following error:
Android NDK: Could not find application project directory !
Android NDK: Please define the
Follow Below steps:
1)Right on your project
2)Go to properties
3)Go to C/C++ Build
4)Go to Builder Settings
5)Go to Build Location
Add build directory
6)Click on Workspace
7)Select your project folder
you should see something like
${workspace_loc:/[Your Project_Name]}
Done!!
NDK_PROJECT_PATH
is an environment variable so you don't have to include in the Android.mk
file. Is nkd-build
launched in the project directory?
For more info read the docs in docs/HOWTO.html
in the NDK folder where I read
Starting with NDK r4, you can simply place the file under $PROJECT/jni/ and launch the 'ndk-build' script from your project tree.
If you want to use 'ndk-build' but place the file to a different location, use a GNU Make variable override as:
ndk-build NDK_APPLICATION_MK=/path/to/your/Application.mk
You need to specify 3 things.
NDK_PROJECT_PATH - the location of your project
NDK_APPLICATION_MK - the path of the Application.mk file
APP_BUILD_SCRIPT - the path to the Android.mk file
These are needed to override the default values of the build script, which expects things to be in the jni folder.
When calling ndk-build use
ndk-build NDK_PROJECT_PATH=/path/to/proj NDK_APPLICATION_MK=/path/to/Application.mk
In Application.mk add
APP_BUILD_SCRIPT := /path/to/Android.mk
Set your ndk builder's working directory could solve your problem as I got the same problem and solved it in this way.
Path: Project Properties -> Builders -> -> Main -> Working Directory
This is what I use, cd
into the project directory and do:
ndk-build NDK_PROJECT_PATH=.
-C
worked for me.
You can also use the mac terminal to do this.