Telling me 2 different NDK version's for Android Studio setup

Hello I am following ( http://cocos2d-x.org/docs/installation/Android-Studio/ ) and just now setting up cocos2d-x for android studio but am confused to which version of NDK I should have because under the first prerequisite ( http://cocos2d-x.org/docs/installation/A/index.html#build-requirements ) it tells me “NDK r11+ and API level 19 is required to build Android games”, but in the second prerequisite ( http://cocos2d-x.org/docs/installation/Android-terminal/index.html ) it says “NDKr10c”. Is this something that just forgot to get updated to NDK r11+, and should I use NDK r11+ ?

10 is our minimum sdk requirement. But yes, this does need updating and is updated in the new docs version. I am also refining the Studio instructions, literally as we speak: https://github.com/cocos2d/cocos2d-x-docs/pull/19

1 Like

sounds excellent!, do you know if there any limitations or major differences in using ndk10 over ndk 11?

honestly, I am not the best person to ask about this. It is a bit to specific for me. @zhangxm any thoughts on ndk 10 over 11?

1 Like

I don’t quite remember the detail, as i remembered, ndk 11 do a big change and break something. And the doc can is not updated according as engine version.

1 Like

For me, this combination is the best for now.
cocos2d -x v3.16
NDK r14

In NDK r15, there was a case that the build failed in the release build even if the build succeeded in the debug build.
I am not familiar with NDK, so I do not know the cause.
However, when I changed to NDK r14 it worked well so I will continue with this combination for a while.

The NDK version used by Android Studio is specified by “ndk.dir=/path/to/ndk” in proj.android-studio/local.properties.
The default may be “<ANDROID_SDK_ROOT>/ndk-bundle”.

2 Likes

@bluewind00 when setting up cocos2d-x 3.16, what did you select for ANDROID_SDK_ROOT since we are setting up for android studio? I don’t think were suppose to put the android studio app directory right ?18 PM

In the second Prerequisite “Completed the Android Command-Line Instructions” ( http://cocos2d-x.org/docs/installation/Android-terminal/index.html ) of the “Android Studio Installation and set up” tutorial ( http://cocos2d-x.org/docs/installation/Android-Studio/ ) it shows this

But we no longer use the adt-bundle that use to be available for download from android dev so it seems like the pics might need to be updated for what variable to enter Regarding to Android Studio not the adt-bundle-mac any more to make it more clear for people following the set up instructions for Cocos2d-x w/ Android Studio.

the only thing I could think of putting for ANDROID_SDK_ROOT is /Applications/Android\ Studio.app , but I don’t think that seems right ?

Do I skip this part of setup or what should I put in for the ANDROID_SDK_ROOT ? thanks !

@slackmoehrle @zhangxm

We are deprecating docs of Eclipse project, if you use Android Studio i think you can ignore it.

1 Like

Ok, you guys might want to remove the ANDROID_SDK_ROOT in the next release then if you are deprecating docs of Eclipse , and update the screen shots in ( http://cocos2d-x.org/docs/installation/Android-terminal/index.html ) so new cocos2d-x users don’t get confused and will make it an easy install process for them.

I think we can not remove ANDROID_SDK_ROOT, it is needed to keep compatibility.

1 Like

okay I see, is it to keep compatibility with Eclipse ? if so you could make a note in http://cocos2d-x.org/docs/installation/Android-terminal/ saying that ANDROID_SDK_ROOT can be ignored if your using android studio, it will make it easier for people to follow.

1 Like

@slackmoehrle will you do it, please?

1 Like

ok, in the current docs or the new docs?

1 Like

The new doc.

1 Like

@slackmoehrle @zhangxm UPDATE: turns out we do need to define the ANDROID_SDK_ROOT even if we are not using eclipse , what should I put as the ANDROID_SDK_ROOT ? I tried this but it is not working27 PM
30 PM

I am not sure, i think ANDROID_SDK_ROOT if you use cocos command, i will double check it.

2 Likes

Do you know what I should set the ANDROID_SDK_ROOT as ? since I don’t have the adt-bundle that it says to set it as in the instructions ?

ANDROID_SDK_ROOT is for command-line development.

Depending upon how you installed the Android SDK your path could be different, but this is mine:

# Add environment variables for Android Cocos2d-x development
export NDK_ROOT=/usr/local/Cellar/android-ndk/r13b
export ANDROID_HOME=/usr/local/opt/android-sdk
export ANDROID_SDK_ROOT=/usr/local/Cellar/android-sdk/24.4.1_1
export PATH=$NDK_ROOT:$PATH
export PATH=$ANDROID_SDK_ROOT:$PATH
export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
1 Like

ok thanks very much !