Android NDK: ERROR: You NDK_MODULE_PATH variable contains spaces
最新推荐文章于 2021-05-27 14:33:04 发布
本文解决了一个在使用Cocos2d-X构建项目时遇到的编译错误问题,该错误源于项目路径中包含空格。通过调整项目目录结构至不含空格的位置,成功避免了编译过程中出现的问题。
本文解决了一个在使用Cocos2d-X构建项目时遇到的编译错误问题,该错误源于项目路径中包含空格。通过调整项目目录结构至不含空格的位置,成功避免了编译过程中出现的问题。
1992
749
来自: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/