cocos sdkbox android 接入注意

1 jin/Android.mk  中 LOCAL_SRC_FILES 链接的是runtime-src/Classes中的cpp文件

2  jin/Android.mk 若 LOCAL_LDLIBS := -landroid -llog 则Eclips可看到cocos2d.o的编译信息,编译速度较慢

3 sdk的java文件要用LOCAL_WHOLE_STATIC_LIBRARIES :=  加载静态库 

大概这样:只接了 facebook

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 ../../Classes/PluginFacebookJS.cpp ../../Classes/PluginFacebookJS.hpp ../../Classes/PluginFacebookJSHelper.cpp ../../Classes/PluginFacebookJSHelper.h ../../Classes/SDKBoxJSHelper.cpp ../../Classes/SDKBoxJSHelper.h

#LOCAL_LDLIBS := -landroid -llog
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes

LOCAL_WHOLE_STATIC_LIBRARIES := PluginFacebook sdkbox

LOCAL_STATIC_LIBRARIES := cocos2d_js_static

LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT

include $(BUILD_SHARED_LIBRARY)
$(call import-add-path, $(LOCAL_PATH))

$(call import-module, scripting/js-bindings/proj.android)
$(call import-module, ./sdkbox)
$(call import-module, ./pluginfacebook)

 

4工程链接第三方库文件需要在project.properties中添加路径

target=android-17

android.library.reference.1=../../cocos2d-x/cocos/platform/android/java
android.library.reference.2=./libs/facebook_lib

当然工程中需要import 此lib

Eclips 右键 Package Explorer,点击import 选择工程文件夹,选择需要导入的库

 

你可能感兴趣的:(cocos sdkbox android 接入注意)