Android NDK: ERROR: You NDK_MODULE_PATH variable contains spaces

来源:互联网 发布:淘宝游戏点卡货源 编辑:程序博客网 时间:2024/06/05 19:54

来自:http://paralaxer.com/cocos2d-x-project-setup/

I create project on windows first , and then create meta-project ( copy project to new folder Desktop/MyMetaProject ) and I success with run on windows , but when I run make with terminal , I got an error

$ make
./build_native.sh
NDK_ROOT = E:/Download/Android/android-ndk-r8b
COCOS2DX_ROOT = /cygdrive/c/Users/Vinh Loc/Desktop/SuperTeo meta-project/MyProject/SuperTeo/proj.android/../../..
APP_ROOT = /cygdrive/c/Users/Vinh Loc/Desktop/SuperTeo meta-project/MyProject/SuperTeo/proj.android/..
APP_ANDROID_ROOT = /cygdrive/c/Users/Vinh Loc/Desktop/SuperTeo meta-project/MyProject/SuperTeo/proj.android
Using prebuilt externals
Android NDK: ERROR: You NDK_MODULE_PATH variable contains spaces
Android NDK: Please fix the error and start again.
make[1]: Entering directory `/cygdrive/c/Users/Vinh Loc/Desktop/SuperTeo meta-project/MyProject/SuperTeo/proj.android’
/cygdrive/e/Download/Android/android-ndk-r8b/build/core/setup-imports.mk:27: *** Android NDK: Aborting . Stop.
make[1]: Leaving directory `/cygdrive/c/Users/Vinh Loc/Desktop/SuperTeo meta-project/MyProject/SuperTeo/proj.android’
makefile:2: recipe for target `all’ failed
make: *** [all] Error 2



Not to worry. The error message “Your NDK_MODULE_PATH variable contains spaces” says it all. The problem is in these lines of build_native.sh:

echo “Using prebuilt externals”
“$NDK_ROOT”/ndk-build -C “$APP_ANDROID_ROOT” $* \
“NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt”

Because your COCOS2DX_ROOT contains spaces (“Vinh Loc” and “SuperTeo meta-project”) it is causing this line to fail. This is actually a bug in Cocos2d-X which can be fixed. They have fixed the issue on many of the other lines by wrapping the variables in quotes, like this:

mkdir “$APP_ANDROID_ROOT”/assets

Can you please post in the forums of cocos2d-x.org so this issue can be resolved?

In the meantime, you can easily get it working on your system by putting your meta-project in a safe, spaces-free directory, like /cygdrive/c/Projects/MyProject/

去掉(“Vinh Loc” and “SuperTeo meta-project”)这些词的空格,这些空格在COCOS2DX中是一个bug,会导致错误!

原创粉丝点击