Try the additions I’ve listed in this:
LOCAL_PATH := $(call my-dir)
COCOS_ROOT := /Applications/cocos2d-x
include $(CLEAR_VARS)
$(call import-add-path,$(COCOS_ROOT))
$(call import-add-path,$(COCOS_ROOT)/external)
$(call import-add-path,$(COCOS_ROOT)/cocos)
$(call import-add-path,$(COCOS_ROOT)/cocos/audio/include)
LOCAL_MODULE := MyGame_shared
LOCAL_MODULE_FILENAME := libMyGame
LOCAL_SRC_FILES := $(LOCAL_PATH)/hellocpp/main.cpp \
$(LOCAL_PATH)/../../../Classes/AppDelegate.cpp \
$(LOCAL_PATH)/../../../Classes/HelloWorldScene.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes
# ADDED
LOCAL_C_INCLUDES += PATH_TO_YOUR_STATIC_LIB_HEADERS_ETC
# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END
LOCAL_STATIC_LIBRARIES := cocos2dx_static
# ADDED
LOCAL_STATIC_LIBRARIES += YourLibrary_static
# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END
include $(BUILD_SHARED_LIBRARY)
# $(call import-add-path, $(LOCAL_PATH)/../../../cocos2d)
$(call import-add-path, $(COCOS_ROOT))
$(call import-module, cocos)
# ADDED: I think this is only required if you need to build the library, where it has it's own Android.mk
$(call import-module, [PATH TO YOUR STATIC LIBRARY])
# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END
If you’re using Cocos2d-x 3.17+, then consider switching to the CMake way of doing things, which basically means you no longer use Android.mk etc, and CMakeLists.txt works for all platforms, so you don’t need to have different makefiles for different platforms.
http://docs.cocos2d-x.org/cocos2d-x/en/installation/CMake-Guide.html
Edit: Sorry had a mistake in the Android.mk listed above, so it’s now fixed.
Line:
LOCAL_STATIC_LIBRARIES := YourLibrary_static
Should be
LOCAL_STATIC_LIBRARIES += YourLibrary_static