Change the Ndk path post setup.py

Whenever I run setup.py it finds android ndk10 because I set it up this way initially, I want it to use android ndk9. All I need to know is how do you change the path to the ndk post setup. It seems so simple but I can’t find an answer.

Windows, Linux, OS X?

I’m running windows 7

ok, how did you set them the first time? Environment variables?

I opened up the command prompt and ran setup.py in the cocos folder. It asked me for the NDK ADT and ANT so I gave it the paths to those 3. Afterword I realized that I need NDK 9 instead because 10 doesn’t have the proper gcc tool chain. I just can’t figure out how to change which NDK cocos uses. I tried deleting NDK 10 but when I run setup.py It says it still found NDK 10 so it wont ask me for a new one…

I looked at setup.py and it looks like on Windows these are Registry values. I’d use regedit32 and search the registry for those variable names.


You can view edits of this post if you wish.

1. This is how you easily change environment variables in windows:

Get into system. Advanced Settings to open properties, advanced tab, enviroment variables at very bottom. and voila.

**2. Toolchains **

-current copy of build_native.py checks only for:
toolchains/arm-linux-androideabi-4.4.3 and toolchains/arm-linux-androideabi-4.7

-neither r8b, r9, r9b, or r10 contains 4.7 (am searching for other revisions of 9)

-When 4.4.3 is detected APP_STL value: c++_static is invalid. The cocos2d wiki tells us that

"NDK-r4 does NOT support STL. Unfortunately, the engine depends on it, so we need to find a version that supports it. Luckily, some one has already done it. You can download it here: https://www.crystax.net/android/ndk.php? "

This brings up the same c++_static problem. Editing 4.43 out of the build_native.py allows running to detect 7 instead. Still, APP_STL value: c++_static is invalid.

-altering the build_native.py code to search for other versions results in syntax errors.

3. SOLUTION

http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86.zip

I’ve been through all the revisions. This is the only one that compiles. Hope this helps you. If you messed up your build_native.py just delete project and make a new one cocos.py new projectname -p blah.company.name -l language and whatever.

1 Like