Set Build path in Eclipse for ndk program
Asked Answered
H

3

28

This error was shown when I build a android application program in Eclipse:

14:43:33 **** Incremental Build of configuration Default for project com.***.NDKDemo ****
ndk-build all 
Cannot run program "ndk-build": Unknown reason

Error: Program "ndk-build" not found in PATH
PATH=[/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]

14:43:33 Build Finished (took 16ms)

Please give me a solution to include the build path in Eclipse..

Herzen answered 6/8, 2012 at 9:22 Comment(0)
S
63

//goto Preference Android NDK and choose your ndk location

enter image description here

or

in your hidden .bashrc file add this below line

export NDK_PATH=/home/padmakumar/android-ndk-r7b
Stretch answered 6/8, 2012 at 9:50 Comment(1)
This worked on one machine (MacBook Pro with latest OSX), but not another (OSX 10.7.5). ANy ideas? I'm hesitant to add the NDK directory to my path, although that seems like the only way.Lactoflavin
C
33

If your NDK location is already set, the builder in the toolchain editor may be wrong. Go to project properties, C/C++ Build | Tool Chain Editor and select Android Builder as current builder.

Contemn answered 13/1, 2014 at 11:5 Comment(1)
This is the proper way to do it in Eclipse. In that case, when changing the location of the NDK in Window -> Android -> NDK, Eclipse would call the correct ndk-build on all project. If you want to mix different NDKs on multiple projects, probably it would be best to use some build variables in Eclipse (Properties -> C++ Build -> Build Variables).Fawcette
D
5

The path for ndk-build is not set in your case. Open your .bashsrc file ( from root folder, it will be in hidden format, so Edit Menu and selection Show Hidden Files ) with Editor, go to last line and add following code,

NDK_HOME=/opt/android-ndk-r8
export NDK_HOME

Now restart your Computer and try again. For more information see my this answer.

Delaunay answered 6/8, 2012 at 9:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.