6

I am trying to develop a Android project that makes a simple call from Java code to native C code. I refer this link for my guidance: http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/

when I am compiling the native.c using

:ndk-build

it shows:

ndk-build command not found

Could anyone give the reason for this?

thanks ,

0

2 Answers 2

4

From your question description, i assume that your path is not set. You need to set your NDK path in your environment variable.

for more information you can visit following site.

Sign up to request clarification or add additional context in comments.

Comments

0

From my part, I try to set the path by several ways:

  • complete the /etc/paths file with the ndk directory and restart the Mac
  • use the shell command: export NDK_HOME=/Users/myself/directory1/directory2/android-ndk-r9
  • use the Eclipse menu: Eclipse > Preferences > Android > NDK

However I always get the error message: "ndk-build command not found"

Finally I solved the issue by setting the path directly in the Build command field of the C/C++ Build Properties dialog box: /Users/myself/directory1/directory2/android-ndk-r9/ndk-build I know it's not a proper solution but it works for me for now.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.