I was working on integrating FMOD Studio with my Cocos2dx cross-platform game (iOS,win32 and Android),6 moths ago. Everything works perfectly in iOS and win32, but in the Android project I’m linking into some problems,today.The file type of ‘.ogg’ is supported by android,so I didn’t add fmod in android project. But,now ,I want to use fmod in android project,what should I do?I managed to build Cocos2d-x with FMOD on Android. Here is what I did:
LOCAL_PATH := $(call my-dir)
— 引用 libBugly.so —
include $(CLEAR_VARS)
LOCAL_MODULE := bugly_native_prebuilt
可在Application.mk添加APP_ABI := armeabi armeabi-v7a 指定集成对应架构的.so文件
LOCAL_SRC_FILES := prebuilt/$(TARGET_ARCH_ABI)/libBugly.so
include $(PREBUILT_SHARED_LIBRARY)
— end —
include $(CLEAR_VARS)
LOCAL_MODULE := fmod_native_prebuilt
LOCAL_SRC_FILES := prebuilt/$(TARGET_ARCH_ABI)/libfmod.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := fmodL_native_prebuilt
LOCAL_SRC_FILES := prebuilt/$(TARGET_ARCH_ABI)/libfmodL.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := cocos2dlua_shared
LOCAL_CFLAGS += -DCOCOS2D_DEBUG=1
LOCAL_MODULE_FILENAME := libcocos2dlua
LOCAL_SRC_FILES :=
…/…/Classes/AppDelegate.cpp
…/…/Classes/ide-support/SimpleConfigParser.cpp
…/…/Classes/ide-support/RuntimeLuaImpl.cpp
…/…/Classes/ide-support/lua_debugger.c
…/…/Classes/lua-modules/md5/md5.cpp
…/…/Classes/lua-modules/md5/lua_md5.cpp
…/…/Classes/network/ODSocket.cpp
…/…/Classes/network/SocketClient.cpp
…/…/Classes/lua-modules/DataMgr/GameDataManager.cpp
…/…/Classes/lua-modules/DataMgr/lua_DataMgr_c.cpp
…/…/Classes/lua-modules/devinfo/DeviceInfo.android.cpp
…/…/Classes/lua-modules/devinfo/devinfo.cpp
…/…/Classes/lua-modules/file.cpp
…/…/Classes/lua-modules/pack2lua/Protocal.cpp
…/…/Classes/lua-modules/pack2lua/lua_Protocal_c.cpp
…/…/Classes/lua-modules/TouchID/lua_touchid.cpp
…/…/Classes/lua-modules/TouchID/TouchID.cpp
…/…/Classes/lua-modules/http/lua_http.cpp
…/…/Classes/lua-modules/EventCenter/EventCenter.cpp
…/…/Classes/lua-modules/lua_modules.cpp
…/…/Classes/lua-modules/pack2lua/CodeConvert.cpp
…/…/Classes/lua-modules/lpeg/lpcap.c
…/…/Classes/lua-modules/lpeg/lpcode.c
…/…/Classes/lua-modules/lpeg/lpprint.c
…/…/Classes/lua-modules/lpeg/lptree.c
…/…/Classes/lua-modules/lpeg/lpvm.c
…/…/Classes/lua-modules/pbc/binding/lua/pbc-lua.c
…/…/Classes/lua-modules/qjson/json.cpp
…/…/Classes/lua-modules/qjson/lua_json.cpp
…/…/Classes/lua-modules/bugly/BuglyLuaAgent.cpp
…/…/Classes/lua-modules/bugly/CrashReport.cpp
…/…/Classes/lua-modules/cjson/fpconv.c
…/…/Classes/lua-modules/cjson/lua_cjson.c
…/…/Classes/lua-modules/cjson/strbuf.c
…/…/Classes/lua-modules/fmodplayer/FmodPlayer.cpp
…/…/Classes/lua-modules/fmodplayer/lua_FmodPlayer.cpp
hellolua/main.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes
$(LOCAL_PATH)/…/…/…/cocos2d-x/cocos/platform/android/jni
$(LOCAL_PATH)/…/…/Classes/network
$(LOCAL_PATH)/…/…/Classes/network/uuid
$(LOCAL_PATH)/…/…/Classes/lua-modules/md5
$(LOCAL_PATH)/…/…/Classes/lua-modules/DataMgr
$(LOCAL_PATH)/…/…/Classes/lua-modules/devinfo
$(LOCAL_PATH)/…/…/Classes/lua-modules
$(LOCAL_PATH)/…/…/Classes/lua-modules/pack2lua
$(LOCAL_PATH)/…/…/Classes/lua-modules/TouchID
$(LOCAL_PATH)/…/…/Classes/lua-modules/http
$(LOCAL_PATH)/…/…/Classes/lua-modules/EventCenter
$(LOCAL_PATH)/…/…/Classes/lua-modules/lpeg
$(LOCAL_PATH)/…/…/Classes/lua-modules/pbc
$(LOCAL_PATH)/…/…/Classes/lua-modules/qjson
$(LOCAL_PATH)/…/…/Classes/lua-modules/bugly
$(LOCAL_PATH)/…/…/Classes/lua-modules/cjson
$(LOCAL_PATH)/…/…/Classes/lua-modules/fmodplayer/FmodLib/inc
$(LOCAL_PATH)/…/…/Classes/lua-modules/fmodplayer
_COCOS_HEADER_ANDROID_BEGIN
_COCOS_HEADER_ANDROID_END
LOCAL_STATIC_LIBRARIES := cocos2d_lua_static
LOCAL_STATIC_LIBRARIES += cocos2dxandroid_static
LOCAL_WHOLE_STATIC_LIBRARIES += pbc_static
_COCOS_LIB_ANDROID_BEGIN
_COCOS_LIB_ANDROID_END
include $(BUILD_SHARED_LIBRARY)
$(call import-module,scripting/lua-bindings/proj.android)
$(call import-module,platform/android)
$(call import-module,pbc)
_COCOS_LIB_IMPORT_ANDROID_BEGIN
_COCOS_LIB_IMPORT_ANDROID_END