我正在尝试将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" />
是什么导致了这个问题
我在哪里定义蚂蚁导入的搜索路径?
我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)
按以下步骤解决这可能不是一个正确的方法,因为它涉及手动修改local.properties
,但它工作。
1。错误
/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.8/frameworks/cocos2d-x/plugin/protocols/proj.android/build.xml:90: Cannot find /pp/src/shared_js/cocos/3.8/frameworks/cocos2d-x/plugin/protocols/proj.android/${plugin.dir}/tools/android/build_common.xml imported from /pp/src/shared_js/cocos/3.8/frameworks/cocos2d-x/plugin/protocols/proj.android/build.xml
修复:
$ vi /pp/src/shared_js/cocos/3.8/frameworks/cocos2d-x/plugin/protocols/proj.android/local.properties
# add this line
plugin.dir=../..
2。错误
/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.8/frameworks/cocos2d-x/plugin/plugins/facebook/proj.android/build.xml:90: Cannot find /pp/src/shared_js/cocos/3.8/frameworks/cocos2d-x/plugin/plugins/facebook/proj.android/${plugin.dir}/tools/android/build_common.xml imported from /pp/src/shared_js/cocos/3.8/frameworks/cocos2d-x/plugin/plugins/facebook/proj.android/build.xml
修复
$ vi /pp/src/shared_js/cocos/3.8/frameworks/cocos2d-x/plugin/plugins/facebook/proj.android/local.properties
# add this line
plugin.dir=../../..