OSX build_native.sh problem

Hello all,
I am starting cocos2dx.
I followed tutorial to set up iOS/android cross-platform development
when I tried to build android native code with build_native.sh, it says please define NDK_ROOT
but I already defined NDK_ROOT

echo $NDK_ROOT
/Users/kevin0228ca/Documents/SDK/android-ndk

I should have NDK_ROOT set up, right?
can anyone figure out what might be the problem?
I am using ndk-r8b
thanks

Yeah I have the same problem I don’t know where to define the NDK_ROOT in the build_native.sh file. I am using windows 7.
It was clearly mentioned in the previous version.

If any one knows about this please help us.

I alse met this problem.

in the file ~/.bash_profile, I have define the path

 24 export CDX_ROOT=/Bing/File/cocos2d/cocos2d-x/cocos2d-2.0-x-2.0.2
 25 export NDK_ROOT=/Bing/Android/sdk/android-ndk-r8b
 26 export ANDROID_SDK_ROOT=/Bing/Android/sdk/android-sdk-macosx
 27 export PATH=$PATH:$CDX_ROOT
 28 export PATH=$PATH:$NDK_ROOT
 29 export PATH=$PATH:$ANDROID_SDK_ROOT

and I can get the right result from commdline: cd $NDK_ROOT
but in the eclipse,when I build the project, I get the results:

09:06:21 **** Incremental Build of configuration Default for project com.bing.games.test2.test2 ****
bash /Bing/File/cocos2d/cocos2d-x/cocos2d-2.0-x-2.0.2/test2/proj.android/build_native.sh NDK_DEBUG=1 V=1 all 
please define NDK_ROOT

09:06:21 Build Finished (took 111ms)

Anybody can help me? Is it a bug for the new version of cocos2d-x?

Hi guys ,
Any body solved it?
Thnaks
nikhil

Anyone know the problem to this question?
I clearly have NDK_ROOT defined
I am using cocos2dx-2.0.3
Right now, I have no choice but to test the android project on a Windows PC, but I want to be able to test android project on Mac

kevin fan wrote:

Hello all,
I am starting cocos2dx.
I followed tutorial to set up iOS/android cross-platform development
when I tried to build android native code with build_native.sh, it says please define NDK_ROOT
but I already defined NDK_ROOT
>
echo $NDK_ROOT
/Users/kevin0228ca/Documents/SDK/android-ndk
>
I should have NDK_ROOT set up, right?
can anyone figure out what might be the problem?
I am using ndk-r8b
thanks

Hello!

I am using ndk-r8c and cocos2dx-2.0.4 and I have the same issue… Any idea?

Thanks!

try to change the path in build_native.sh file.

paste at the top of the file:
NDK_ROOT=“/your_path/android-ndk-r8”

Sandy Cnigniet wrote:

try to change the path in build_native.sh file.
>
paste at the top of the file:
NDK_ROOT=“/your_path/android-ndk-r8”

Thank you.
That solved the problem.

if you use ~./bash_profile then read below…

Your ‘External Tool Command’ (Eclipse/IntelliJ) should be something like:
/bin/bash —login build_native.sh

  • Set Program as: /bin/bash
  • Parameters as: —login build_native.sh (Note: —login is used so that your .bash_profile file is read into the command)
  • Working Folder as:

who can help me to fix follow problem ,thank you:
proj.android/build_native.sh -> ‘to_string’ is not a member of ‘std’

to resolve : please define NDK_ROOT
in eclipse project=>properties=>C/C++Build=>Environment
click on “add”
name=NDK_ROOT
value=/your_path/android-ndk-r9b
e.g.
value=/home/NDK_r9b/android-ndk-r9b