1

I am new to NDK and cygwin. and after installing NDK, I used cygwin to run the following command:

§ ndk-build

but the result was:

-bash: ndk-build: command not found

The below image is to show how I set the path for NDK, is it correct?

How to fix this issue?

image

StackExchange
  • 432
  • 2
  • 8
  • 22
rmaik
  • 1,076
  • 3
  • 15
  • 48

2 Answers2

1

You need to set the NDK_ATH variable to C:\NDK\android-ndk-r10d. It could not include the ndk-build command

Prasad
  • 3,462
  • 1
  • 23
  • 28
  • ok, nowwhen i type $ndk-build in cygwin, i receive "command not found" – rmaik Aug 22 '15 at 13:35
  • Your ndk-build will be in your ndk bin directory..Please set it to bin directory – Prasad Aug 22 '15 at 13:43
  • i checked the bin directory it was inside this directory "prebuilt\windows-x86_64\" but it has no ndk-buil file – rmaik Aug 22 '15 at 13:50
  • set the path to C:\NDK\android-ndk-r10d and restart the command prompt..and check – Prasad Aug 22 '15 at 13:54
  • know i receive, "cant find 'make' program, please install cygwin make package or define GNUMAKE variable to point to it"...i search fro some related post, and i found one here:http://stackoverflow.com/questions/661939/where-can-i-download-an-offline-installer-of-cygwin and i downloaded the make package required and installed it offline, but i still receive the same error – rmaik Aug 22 '15 at 14:20
0

Being able to execute ndk-build does not depend on setting the environmental variable NDK_PATH or NDK_HOME to the correct location. No!

Execution of this command depends on your PATH variable (might be Path on windows). So what you need to do is to edit your path variable on windows and add the location of the android-ndk to that path and you are set to use the ndk-build command.

To get access to the path variable it is the same process to get to the window you have open above. But this time, you look under System variables and find Path.

  • Copy the contents of the path variable to a text editor (preferably one that wraps long lines)
  • navigate to the android ndk folder (make sure you are inside it)
  • copy it's location from the navigation bar of your file explorer
  • now go back to your text editor with the path variable content in it and add a semicolon [;] to the end of the path
  • finally paste the location you copied to end of that path (after the semicolon)
  • Now copy everything from your text editor and replace the value of your path variable with what you have copied
  • Ok -> Ok -> Confirm -> Save -> etc...

Close and reopen your command line and try typing ndk-build.

Any troubles, leave a comment

smac89
  • 39,374
  • 15
  • 132
  • 179