我试图将Facebook插件整合到全新的cocos-js 3.7项目中。 以下步骤:http://cocos2d-x.org/docs/manual/framework/html5/facebook-sdk/facebook-sdk-on-android/en 以及此插件运行良好的现有3.5项目。
编译时我收到此错误:
BUILD FAILED
/Applications/adt-bundle-mac-x86_64-20130729/sdk/tools/ant/build.xml:470: The following error occurred while executing this line:
/pp/src/shared_js/cocos/3.7/frameworks/cocos2d-x/plugin/protocols/proj.android/build.xml:90: Cannot find /pp/src/shared_js/cocos/3.7/frameworks/cocos2d-x/plugin/protocols/proj.android/${plugin.dir}/tools/android/build_common.xml imported from /pp/src/shared_js/cocos/3.7/frameworks/cocos2d-x/plugin/protocols/proj.android/build.xml
cocos2d-x/plugin/protocols/proj.android/build.xml
中的最后一行有:
<!-- version-tag: 1 -->
<import file="${plugin.dir}/tools/android/build_common.xml" />
导致问题。
我在哪里定义ant导入的搜索路径?
我的Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocos2djs_shared
LOCAL_MODULE_FILENAME := libcocos2djs
LOCAL_SRC_FILES := hellojavascript/main.cpp \
../../Classes/AppDelegate.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
##############################################################################################################
# Library lists
##############################################################################################################
# <Pp> this prevents bugs with += and :=
#
LOCAL_STATIC_LIBRARIES :=
LOCAL_WHOLE_STATIC_LIBRARIES :=
# cocos 3.7
#
LOCAL_STATIC_LIBRARIES += cocos2d_js_static
# plugin: ALL (JS & C++)
# plugin: FB
#
# <REF> /pp/dev-cpp/libs/cocos2d-js-v3.5/samples/js-tests/project/proj.android/jni/Android.mk
#
LOCAL_STATIC_LIBRARIES += jsb_pluginx_static
# plugin: ALL (JS & C++)
# plugin: FB
#
LOCAL_WHOLE_STATIC_LIBRARIES += PluginProtocolStatic
##############################################################################################################
# Flags, etc.
##############################################################################################################
# cocos 3.7
#
LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT
# cocos 3.7
#
include $(BUILD_SHARED_LIBRARY)
##############################################################################################################
# Module search paths
##############################################################################################################
# Pp: believed to be required by plugins and also some other staff...
#
$(call import-add-path,$(LOCAL_PATH)/../../../../frameworks/cocos2d-x/plugin/publish)
$(call import-add-path,$(LOCAL_PATH)/../../../../frameworks/cocos2d-x/external)
$(call import-add-path,$(LOCAL_PATH)/../../../../frameworks/cocos2d-x/cocos)
# Pp (after upgrade to cocos 3.7)
#
$(call import-add-path,$(LOCAL_PATH)/../../../../frameworks)
# Soomla (also generic)
#
$(call import-add-path,$(LOCAL_PATH)/../../../../frameworks/cocos2d-x)
##############################################################################################################
# Import Modules
##############################################################################################################
# cocos 3.7
#
$(call import-module, scripting/js-bindings/proj.android)
# plugin: ALL (JS)
# plugin: FB
#
# <REF> /pp/dev-cpp/libs/cocos2d-js-v3.5/samples/js-tests/project/proj.android/jni/Android.mk
#
#
$(call import-module,cocos2d-x/plugin/jsbindings)
# plugin: ALL (C++)
# plugin: FB
#
# <REF> /pp/src/shared_js/cocos/3.5/frameworks/js-bindings/cocos2d-x/plugin/samples/HelloPlugins/proj.android/jni/Android.mk
#
$(call import-module,plugin/protocols/proj.android/jni)