F:\cocos2d-x-3.2\tools\cocos2d-console\bin\HelloCpp\proj.android>python build_native.py

The Selected NDK toolchain version was 4.8 !

系统找不到指定的路径。

Traceback (most recent call last):

File “build_native.py”, line 159, in

build(opts.ndk_build_param,opts.android_platform,opts.build_mode)

File “build_native.py”, line 146, in build

do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)

File “build_native.py”, line 82, in do_build

raise Exception(“Build dynamic library for project [ ” + app_android_root + ” ] fails!”)

Exception: Build dynamic library for project [ F:\cocos2d-x-3.2\tools\cocos2d-console\bin\HelloCpp\proj.android ] fails!

解决方案:

def check_environment_variables():

”’ Checking the environment NDK_ROOT, which will be used for building

”’

try:

// 这里改成你ndk的绝对路径

NDK_ROOT = “/Users/android/android-ndk-r9d”

except Exception:

print “NDK_ROOT not defined. Please define NDK_ROOT in your environment”

sys.exit(1)

return NDK_ROOT