Having integrated FMOD into my project, I have a very non-standard setup for my NDK Makefiles and I have recently started trying to integrate Google Analytics.
Having tried the automatic setup from sdkbox-ui and commandline, the typical setup of adding
LOCAL_WHOLE_STATIC_LIBRARIES := PluginGoogleAnalytics
$(call import-module, ./plugingoogleanalytics)
does not work, it results in
Android NDK: jni/Android.mk: Cannot find module with tag ‘./plugingoogleanalytics’ in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
I’ve tried endlessly to get this to work with my setup to no avail, trying to use
include jni/fmod/Android.mk
in my Android.mk or adding LOCAL_WHOLE_STATIC_LIBRARIES into my specific cocos2dx module…
Could someone possibly give some advice how to setup SDKBOX with my configuration? I understand NDK to a fairly basic level (outside of managing to add FMOD compilation) and SDKBOX doesn’t really provide any guidance outside the automatic installer.
My setup has two Android.mk files in subdirectories (fmod & main), for fmod and for cocos2dx (standard cocos2dx makefile), both of which are included from a top-level Android.mk
/jni
-> /fmod
-> /main
-> /plugingoogleanalytics
Top-level /jni/Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include jni/fmod/Android.mk
include jni/main/Android.mk
and my Android.mk for cocos2dx (main) looks like such
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_SHARED_LIBRARIES := fmod \
fmodProvider
LOCAL_MODULE_FILENAME := libcocos2dcpp
LOCAL_CFLAGS += -std=c++11
APP_USE_CPP0X := true
NDK_TOOLCHAIN_VERSION := 4.7
PCH_FILE := $(LOCAL_PATH)/header.h
LOCAL_CPPFLAGS += -include $(PCH_FILE)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../Classes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../fmod/
FILE_LIST := $(wildcard $(LOCAL_PATH)/../../../../Classes/*.cpp) \
$(wildcard $(LOCAL_PATH)/../../../../Classes/*.c)
LOCAL_SRC_FILES += $(FILE_LIST:$(LOCAL_PATH)/%=%) \
main.cpp \
PurchaseManagerAndroid.cpp \
# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END
LOCAL_STATIC_LIBRARIES := cocos2dx_static
# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END
include $(BUILD_SHARED_LIBRARY)
$(call import-module,.)
# _COCOS_LIB_IMPORT_ANDROID_BEGIN
I have already previously given up on this and decided to make my own implementation and NDK bridging for in-app purchases having faced this issue for inapp purchases too, however I’d really love to get analytics working as it is a lot more involved to bridge across by hand…