1

I have a problem regarding to cocos2dx v3 setting up android on mac. I use this video (https://www.youtube.com/watch?v=2LI1IrRp_0w) as a guide. In the video everything is doing fine but on my own eclipse, there's an error that shows up under my console tab. This is the statement error that I found : "python /Users/kirbyasterabadilla/Desktop/OracleEye/proj.android/build_native.py -b release all NDK_ROOT not defined. Please define NDK_ROOT in your environment".

I also tried installing NDK plugin inside my eclipse IDE but still can't solve the problem.

Please help me with this one. What should I do to make this error disappear?

  • Define your NDK_ROOT in your enviroment,see http://stackoverflow.com/questions/17676796/define-ndk-root-in-cocos2dx-mutiplatform-game-enviroment – tianwei Sep 23 '14 at 03:24

1 Answers1

2

python /Users/kirbyasterabadilla/Desktop/OracleEye/proj.android/build_native.py -b release all NDK_ROOT not defined. Please define NDK_ROOT in your environment

It sounds like you should export NDK_ROOT from you log in script. Below is from my OS X 10.8.5 machine:

$ cat ~/.bash_profile
# MacPorts Installer addition on 2012-07-19 at 20:21:05
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

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

export JAVA_HOME=`/usr/libexec/java_home`
export ANDROID_HOME="~/.android"
export NDK_ROOT="$ANDROID_NDK_ROOT"

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

According to David Turner on the NDK Mailing List, both ANDROID_NDK_ROOT and ANDROID_SDK_ROOT need to be set because other tools depend on those values (see Recommended NDK Directory?).

Interestingly, Turner said nothing about ANDROID_HOME or NDK_ROOT (and searching the NDK group for ANDROID_HOME returned 0 results).

After modifying ~/.bash_profile, then perform the following (or logoff and back on):

source ~/.bash_profile

If modifying your log in script does not help, then try setting it in Eclipse:

enter image description here

See Setting environment variables.

jww
  • 97,681
  • 90
  • 411
  • 885