我正在尝试编译在cocos2d-x上开发的Android本机应用程序。当我尝试调试我的应用程序,我得到以下错误。
Android NDK: jni/Android.mk: Cannot find module with tag 'CocosDenshion/android' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? Android NDK: The following directories were searched:
我的android.mk文件中有以下几行
$(Call import-add-path,$(LOCAL_PATH)/../../../CocosDenshion/android) LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static include $(BUILD_SHARED_LIBRARY) $(call import-module,CocosDenshion/android) $(call import-module,cocos2dx)
在我的build_native.sh中NDK_MODULE_PATH被定义为
"NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt"
任何人都可以帮我解决这个问题。
之前我有同样的问题
当我在eclipse中定义cocos2dx变量时,它在构建时没有看到,所以发生了错误ndk模块路径
原文链接:https://www.f2er.com/cocos2dx/338178.html当我在eclipse中定义cocos2dx变量时,它在构建时没有看到,所以发生了错误ndk模块路径
然后我尝试设置模块路径硬编码没有变量,它的工作
所以我的ndk模块路径看起来像这样,在Eclipse中也定义了ndk_root
if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ "NDK_MODULE_PATH=/home/myname/adt/cocos2dx:/home/myname/adt/cocos2dx/cocos2dx/platform/third_party/android/source"
这是在我的Windows PC中看起来如何尝试
if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ "NDK_MODULE_PATH=/cygdrive/c/Users/metin/Desktop/cocos2dx:/cygdrive/c/Users/metin/Desktop/cocos2dx/cocos2dx/platform/third_party/android/source" else echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ "NDK_MODULE_PATH=/cygdrive/c/Users/metin/Desktop/cocos2dx:/cygdrive/c/Users/metin/Desktop/cocos2dx/cocos2dx/platform/third_party/android/prebuilt" fi
这是我的Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static include $(BUILD_SHARED_LIBRARY) $(call import-add-path,/cygdrive/c/Users/metin/Desktop/cocos2dx) $(call import-add-path,/cygdrive/c/Users/metin/Desktop/cocos2dx/cocos2dx/platform/third_party/android/prebuilt) $(call import-module,cocos2dx) $(call import-module,external/chipmunk) $(call import-module,extensions)