./build_native.sh please define NDK_ROOT in cocos2d-2.0-x-2.0.2

Hello , please tell me where to mention the NDK_ROOT parameter .
In build_native.sh I have used the set NDK_ROOT = /cygdrive/d/E/android-ndk-r7c-windows/android-ndk-r7c

But in cygwin the see the error : please define NDK_ROOT

Thanks in advance.

Hello, I’ve this problem too in Windows. First you need define NDK_ROOT in your environment variables (d:-ndk-r7c-windows/android-ndk-r7c) but try to put in root (d:-ndk) and download a crystax ndk version because in the normal ndk version appear some errors. Try to download this NDK http://www.crystax.net/en/android/ndk/7#download and configure in your environment variables. Don’t forget reconfigure your create_android.bat

This works for me. I’ll wait this work for you too =)

Pls set you system environment path if you using windows, then restart the cygwin.

I am using MacOS and I had the same problem
Setting the environment variable by printing in the console:

export NDK_ROOT=“/Users/evgenijstacenko/Documents/10_Frameworks/AndroidForCocos/JND/android-ndk-r8d”

has not solved the problem.
BUT I have solved it by correctinп the build_native.sh file -
Inspite of:

  1. paths
    if [ ~~z “${NDK_ROOT+aaa}” ];then
    echo “please define NDK_ROOT”
    exit 1
    fi
    I have used:
    # paths
    export NDK_ROOT=“/Users/evgenijstacenko/Documents/10_Frameworks/AndroidForCocos/JND/android-ndk-r8d”
    if [~~z “${NDK_ROOT+aaa}” ];then
    echo “please define NDK_ROOT”
    exit 1
    fi

Eugene Statsenko wrote:

I am using MacOS and I had the same problem
Setting the environment variable by printing in the console:
>
export NDK_ROOT=“/Users/evgenijstacenko/Documents/10_Frameworks/AndroidForCocos/JND/android-ndk-r8d”
>
has not solved the problem.
BUT I have solved it by correctinп the build_native.sh file -
Inspite of:
>
# paths
if [ ~~z “${NDK_ROOT+aaa}” ];then
echo “please define NDK_ROOT”
exit 1
fi
>
I have used:
# paths
>
export NDK_ROOT=“/Users/evgenijstacenko/Documents/10_Frameworks/AndroidForCocos/JND/android-ndk-r8d”
>
if [~~z “${NDK_ROOT+aaa}” ];then
echo “please define NDK_ROOT”
exit 1
fi

For mac, you can edit you .bash_profile and add the export command there. Everytime the bash is ran, the path is exported. Your solution is correct, too but you might want to put it at the top of the file instead of before the check.

guys, check this:
http://www.cnblogs.com/young40/archive/2012/10/19/cocos2d-x-mac-os-x-android-xcode-ios-development-setup.html

may be you need to define the NDK_ROOT environment variable in the eclips

1 Like

let me tell you something ,you can make it like this :
# paths
NDK_ROOT=“F:_DEV\android-ndk-r7b”
add this before
if [ -z “${NDK_ROOT+aaa}” ];then
echo “please define NDK_ROOT”
exit 1
fi
enjoy!

If you are running on windows the the NDK_ROOT needs to be the cygwin path like /cygdrive/C/android-ndk-r8b
The .sh file that’s using that var is run from within cygwin so needs to be the cygwin path.

@A hunter - opened the .sh file in Sublime-text on windows and entered that line. Worked like a charm.