Search code examples
androidandroid-ndkcygwinsh

Cannot run program "sh": Launching failed


I downloaded cygwin and install. Then copy the ndk file to android folder. The path is C:\Program Files\Android\android-ndk-r9b then add this path to systemVaraible. Then choosen ndk location in Eclipse preference. Then right click the project, select AndroidToold->Add Native support
I'm getting this error: Build of configuration Default for project ImageTargets

(Cannot run program "sh": Launching failed)

Then open the cygwin terminal type $ cd /cygdrive/c/Program Files/Android/androi-ndk-r9b/samples/san-angles ndk-build

Below error i'm getting. Where i made mistake?

-bash: cd: /cygdrive/c/Program: No such file or directory

Solution

  • You don't need cygwin to work with NDK r9b on Windows. But whether you have cygwin installed or not, you should avoid spaces in the file names for your Android NDK or SDK installations. The easy fix would be to specify the path using short name, e.g. C:\Progra~1\Android\android-ndk-r9b.

    See more at The Android emulator is not starting, showing "invalid command-line parameter", or Using Proguard for Android in Eclipse got Error.