Skip to content Skip to sidebar Skip to footer

Ndk-build Not Found As A Command

I have been working with Android SDK for a while & just came across an requirement to use the NDK So, I downloaded the Android NDK for Windows. Jumping on the first example, wh

Solution 1:

Guess that should have been an answer instead of a comment.

You must use Cygwin as your shell in order to run ndk-build. See http://www.cygwin.com/

Solution 2:

Once you have Cygwin installed you can have Eclipse automatically build your project for you by:

  1. Right click on your project, pick properties.

  2. Select "builders" from the left-hand list.

  3. Click "New..." on the right side.

  4. Select "Program" as the configuration type. I name mine "Native Builder"

    Location - c:\cygwin\bin\bash.exe

    Working Directory - c:\cygwin\bin

    Arguments -

    (for NDK r3): --login -c "cd /cygdrive/c/Android_NDK && make APP=myapp"

    (for NDK r4): --login -c "cd /cygdrive/c/ && /cygdrive/c/Android_NDK/ndk-build"

Make sure you have the two hyphens before login and the quotes after the hyphen-c

  1. Now go to the refresh tab

  2. Check "Refresh resources upon completion"

  3. Select "Specific resources"

  4. Click on the "Specify resources" button and select your project's lib directory.

  5. Check "Recursively include sub-folders"

  6. Now go to the build options tab

  7. Check "Allocate Console"

  8. Check "Launch in background"

  9. Check "Run the builder After a Clean"

  10. Check "Run the builder During manual builds"

  11. Check "Run the builder During auto builds"

  12. Check "Specify working set of relevant resources"

  13. Click on "Specify Resources"

  14. Select your project's JNI directory and all files within.

  15. Now click OK on the bottom.

Now you can edit and save in your c files and it will compile and create the .so file on the fly.

Solution 3:

Maybe, your development IDE hides system PATH and uses it's own PATH. I had same problem with MOTODEV Eclipse for Android 3.1. Detailed solution is here: How to solve problem with Motodev Eclipse for Android 3.1: wrong PATH It is for MOTODEV IDE, but Eclipse may have same thing.

Post a Comment for "Ndk-build Not Found As A Command"