昨天我尝试将Box2D添加到我的cocos2dx项目中。出现一个错误,我无法解决它。错误:
[2015-03-06 10:41:41 - libcocos2dx] ERROR: resource directory 'C:\devAndroid\cocos2d-x-3.2\cocos2d-x-3.2\SuperCars\cocos2d\cocos\platform\android\java\res' does not exist
重点是包浏览器本身只在项目文件夹中显示红色感叹号...有时libcocos2dx文件夹也显示红色X. 我尝试过在网上找到的所有东西:
目前, Android.mk 内容如上所述
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp \
../../Classes/RaceScene.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \$(LOCAL_PATH)/../../../Box2D
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,.)
$(call import-module,audio/android)
$(call import-module,Box2D)
我在另一篇Stackoverflow帖子中读到,升级SDK工具时会出现类似的错误。我还没有这样做。
我唯一做的就是尝试添加Box2D模块。
任何帮助都会很棒。谢谢!
答案 0 :(得分:0)