简体   繁体   中英

Android NDK “ndk-build” recognized as an internal or external command batch file

How to install android-ndk. I have set path for the ndk, but still while executing "ndk-build" command i am getting error. fya i am using windows operating system.

It worked for me by:

  1. Opening command prompt and navigating to project
 c:\\eclipse\\workspace\\myproject 
  1. I then executed the ndk-build script from the androif ndk folder

c:\\eclipse\\workspace\\myproject> c:\\android-ndk-r8d\\ndk-build

Well, I encountered thesame problem, I got mine fixed by adding the ndk path to the "path" variable's value in the environment variable(System variable) which left my "path" variable like this

在此输入图像描述

The highlighted path is the path to where i have my ndk extracted. (The semi colon indicates the end of a path).

Though i have tried the option of adding NDK_HOME or ANDROID_NDK_HOME with path to my ndk as value, which doesn't work, I guess those variable are for apps that uses them probably while getting System property,variables or so. But this will work with command prompt

Which error message are you exactly getting?

You will probably need to go through the documentation ( http://developer.android.com/tools/sdk/ndk/index.html#Installing or docs/INSTALL.html, from NDK's installation folder), but, to start off, try answering these first simple basic questions:

  1. Have you added the installation folder to your PATH environment variable?
  2. Have you installed Cygwin (www.cygwin.org) to your Windows system?

Hope that answering to those might got what you needed. If not, let me know.

After installing the android ndk, you must add its install directory to the environement variables under Path Go to Control Panel\\System and Security\\System - advanced system settings - environement variables.

Then you can use either cmd window or Cygwin to execute the command

ndk-build

before execute the command you should go to the directory of what you want to build.

Set path on system variables only not on current user variable:

在此输入图像描述

Though I have added ndk root path in path variable, ndk_build was failing as there was a trailing white space at end of ndk root path. Deleting the extra white space from path worked.

Good question!

I have faced same problem, and solved it.

  1. Add ndk path to system variable , for example NDK_PATH and Restart your computer.

  2. Then you can run ndk-build.cmd with system variable in cmd. Example : %NDK_PATH%\\ndk-build.cmd

  3. It works!!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM