Error: Program “/ndk-build.cmd” is not found in PATH

陌路散爱 提交于 2019-11-30 08:58:32

In Eclipse, highlight your Project, then from the Eclipse menubar at the top, select 'Project->Properties'.

In the list on the left, click on the arrow next to the item 'C/C++ Build' and highlight the item 'Environment'.

In the box that reads 'Environment variables to set' you will have 2 items, CWD and PWD. Click the button that read 'Add...'

In the box that appears, select the Name field and type in NDKROOT.

In the field that reads Value type in the path to where you unzipped the Android NDK.

Click on 'Apply". Boom, done. Do this to any other projects that rely on the NDK.

ndk-build is in the root of the NDK folder.

If printenv PATH | grep ndk does not return a string, you cannot call it.

Append the following to $HOME/.bash_profile:

export NDK_ROOT="<whatever your NDK directory is>"
export PATH="$PATH:$NDK_ROOT"

Then, from the command prompt, type:

. ~/.bash_profile

Now you can run ndk-build from the command prompt.

Program “/ndk-build.cmd” is not found in PATH...

Put your tools on path. Also, you should export ANDROID_NDK_ROOT and ANDROID_SDK_ROOT. See David Turner's answer to Recommended NDK Directory? on the NDK mailing list for the reasons.

Here's what my .bash_profile looks like on OS X. Tools like ndk-build and keytool are on path:

$ cat ~/.bash_profile
export PS1="\h::\W$ "
...

# MacPorts Installer addition on 2012-07-19 at 20:21:05
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

# Android
export ANDROID_NDK_ROOT=/opt/android-ndk-r10e
export ANDROID_SDK_ROOT=/opt/android-sdk-macosx

export ANDROID_HOME=~/.android
export JAVA_HOME=`/usr/libexec/java_home`

export PATH="$ANDROID_SDK_ROOT/tools/":"$ANDROID_SDK_ROOT/platform-tools/":"$PATH"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!