Ndk-build.cmd command not found

When trying to develop Hello World NDK program on Ubuntu with the following options

  • sdk path /home/gufran/ADT2/sdk

  • ndk path /home/gufran/ADT2/android-ndk-r10e

I have successfully generated com_appxperts_firstndkapp_MainActivity.h

as well MyJNI.c

. Now I would like to generate .so files with the command

home/gufran/ADT2/android-ndk-r10e/ndk-build.cmd

      

but its giving an error

bash: home/gufran/ADT2/ndk/ndk-build.cmd: No such file or directory

      

Also tried

ndk-build.cmd

      

still bug

ndk-build.cmd: command not found

      

Note that the NDK path is already set as

gufran@gufranKhurshid:~$ export NDK_HOME=home/gufran/ADT2/android-ndk-r10e

      

+3


source to share


2 answers


First of all, find jni

your project directory in the directory on the command line if your files are available there .c

. Then just enter the command:

export NDK=enter your ndk path here  
export PATH=$NDK:$PATH 

      



then run the command ndk-build

. it will generate your files *.so

in libs folder

+3


source


Ndk-build.cmd command not found ...

Put your tools on the path. In addition, you must export ANDROID_NDK_ROOT

and ANDROID_SDK_ROOT

. See David Turner's answer to Recommended NDK Directory? on the NDK mailing list for reasons.

Here mine .bash_profile

looks like OS X. For Ubuntu I believe you are using .profile

. Tools like ndk-build

and keytool

are on the way:



$ cat ~/.bash_profile
export PS1="\h::\W$ "
...

# Android
export ANDROID_NDK_ROOT=/opt/android-ndk-r10e
export ANDROID_SDK_ROOT=/opt/android-sdk-macosx

export ANDROID_HOME=~/.android
export JAVA_HOME=`/usr/libexec/java_home`

export PATH="$ANDROID_SDK_ROOT/tools/":"$ANDROID_SDK_ROOT/platform-tools/":"$PATH"

      

Finally, run ndk-build

instead of ndk-build.cmd

. I believe it is ndk-build.cmd

for Windows.

+2


source







All Articles