Set NDK_MODULE_PATH for cocos2dx Android

时光毁灭记忆、已成空白 提交于 2020-01-11 06:45:11

问题


I am very new to cocos2dx for android.Now i install cygwin and all enviroment variables . Now when i compile and bulid my project (sample project) it gives message and error that NDK_MODULE_PATH not found . Here is my 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'

And give error in file JNI/android.mk

on this line :

$(call import-module,C:\cocos2d-x-2.2;C:\cocos2d-x-2.2\cocos2dx\platform\third_party\android\prebuilt)

any help will be appreciated

UPDATED After Deleting and importing project again without copy into workspace its giving this error on run as android project after build project:

[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

回答1:


In the build_native.sh file add the path of your NDK

# paths

NDK_ROOT = "E:\android-ndk-r8e-windows-x86\android-ndk-r8e"




回答2:


Make sure that "Copy project into workspace" is unchecked before importing project into package explorer. This will resolve the error. Also make sure that you have set the environment variable named NDK_ROOT pointing at the url where you have placed the unzipped Android NDK package.



来源:https://stackoverflow.com/questions/20045033/set-ndk-module-path-for-cocos2dx-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!