我是cocos2dx for android的新手。现在我安装了cygwin和所有环境变量。现在当我编译并构建我的项目(示例项目)时,它会给出消息和错误 NDK_MODULE_PATH not found 。 这是我的LOGCAT:
14:26:15 **** Incremental Build of configuration Default for project HelloCpp ****
bash C:/Workspace/HelloCpp/build_native.sh NDK_DEBUG=1 V=1
NDK_ROOT = C:\android-ndk-r9b
COCOS2DX_ROOT = /cygdrive/c/Workspace/HelloCpp/../../../..
APP_ROOT = /cygdrive/c/Workspace/HelloCpp/..
APP_ANDROID_ROOT = /cygdrive/c/Workspace/HelloCpp
Using prebuilt externals
+ 'C:\android-ndk-r9b/ndk-build' -C /cygdrive/c/Workspace/HelloCpp NDK_DEBUG=1 V=1 NDK_MODULE_PATH=/cygdrive/c/Workspace/HelloCpp/../../../..:/cygdrive/c/Workspace/HelloCpp/../../../../cocos2dx/platform/third_party/android/prebuilt
make: Entering directory '/cygdrive/c/Workspace/HelloCpp'
Android NDK: WARNING: Ignoring unknown import directory: /cygdrive/c/Workspace/HelloCpp/../../../../cocos2dx/platform/third_party/android/prebuilt
jni/Android.mk:19: *** Android NDK: Aborting. . Stop.
Android NDK: jni/Android.mk: Cannot find module with tag 'hellocpp_shared' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Leaving directory '/cygdrive/c/Workspace/HelloCpp'
在 JNI / android.mk
文件中输入错误在这一行:
$(call import-module,C:\cocos2d-x-2.2;C:\cocos2d-x-2.2\cocos2dx\platform\third_party\android\prebuilt)
任何帮助将不胜感激
已更新 在没有复制到工作区的情况下再次删除和导入项目之后,在构建项目之后将其作为android项目运行时出现此错误:
[2013-11-18 15:30:01 - HelloCpp] (skipping file '.gitignore' due to ANDROID_AAPT_IGNORE pattern '.*')
[2013-11-18 15:30:01 - HelloCpp] Unable to add 'C:\cocos2dx2\samples\Cpp\HelloCpp\proj.android\assets\fonts\Marker Felt.ttf': Zip add failed
[2013-11-18 15:30:01 - HelloCpp] ERROR: unable to process assets while packaging 'C:\cocos2dx2\samples\Cpp\HelloCpp\proj.android\bin\resources.ap_'
[2013-11-18 15:30:01 - HelloCpp] ERROR: packaging of 'C:\cocos2dx2\samples\Cpp\HelloCpp\proj.android\bin\resources.ap_' failed
答案 0 :(得分:2)
确保在将项目导入包浏览器之前取消选中“将项目复制到工作区”。这将解决错误。还要确保已将名为NDK_ROOT的环境变量设置为指向已放置解压缩的Android NDK程序包的URL。
答案 1 :(得分:0)
在build_native.sh文件中添加NDK的路径
#path
NDK_ROOT =“E:\ android-ndk-r8e-windows-x86 \ android-ndk-r8e”