Android NDK: ERROR: You NDK_MODULE_PATH variable contains spaces

本文解决了一个在使用Cocos2d-X构建项目时遇到的编译错误问题,该错误源于项目路径中包含空格。通过调整项目目录结构至不含空格的位置,成功避免了编译过程中出现的问题。

来自: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,会导致错误!

评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值