29

When i am trying to import a project to my workspace it shows an error

[2013-03-17 16:14:15 - Unable to launch cygpath. Is Cygwin on the path?] java.io.IOException: Cannot run program "cygpath": CreateProcess error=2, The system cannot find the file specified

this project contains jni libraries,it is a ndk based project.why this error happen i cant import this project to my system.

jithu
  • 706
  • 1
  • 9
  • 13
  • 2
    http://stackoverflow.com/questions/12466074/opencv-native-samples-are-not-building ,get some useful information from here. – jithu Mar 17 '13 at 13:18

3 Answers3

26

go to your project right click there.then take properties and select the c/c++ build and there you can see the build settings .and in the build settings give the path of ndk in your system like:

D:\android\android-ndk-r8d\ndk-build.cmd NDK_DEBUG=1

Now clean your project and run. Thats it.

Shamim Ahmmed
  • 8,265
  • 6
  • 25
  • 36
Jithu P.S
  • 1,843
  • 1
  • 19
  • 32
  • 2
    i have same problem but can't feagure out with your solution – jigar Oct 23 '13 at 10:23
  • 2
    in build settings, where to give path ndk?? I don't find any way to give path of NDK. Can you please reply? – Shirish Herwade Mar 25 '15 at 16:22
  • @ShirishHerwade, you can find it under C/C++ Build -> Environment, then add an environment variable named NDKROOT with the ndk path as its value. – Nate Sep 02 '15 at 19:46
3

With NDK r8d, you don't need cygwin. Maybe the project you import was tuned for an older version, and maybe it defined ndk-build.sh as the C++ build command. You should use ndk-build.cmd or simply ndk-build (utilizing Windows command line conventions)

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
0

You can set an environment variable

NDK_HOME = [your path to ndk]
Juan M. Rivero
  • 807
  • 13
  • 18