cocos2dx 3.8.1 google play services integration

Hello,

I’m updating the project from cocos2dx 3.5 to 3.8.1 and I have a problem with google play game services (c++ version).
I’ve implemented gpg as described in this tutorial: https://nakedmonkeygames.wordpress.com/2015/02/05/how-to-use-the-google-play-game-servies-gpgs-native-on-cocos2d-x-2-x-and-3-x/

Project does not compile, I get the following error:

proj.android/../cocos2d/cocos/platform/android/javaactivity-android.cpp:41:40: fatal error: gpg/android_initialization.h: No such file or directory
 #include "gpg/android_initialization.h"

Here’s my Android.mk file:

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_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../ -- other classes --

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../cocos2d/external/gpg/include/android

# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END

LOCAL_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_gpg_static

# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,gpg/prebuilt/android)

# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END

Please note that it works on cocos2dx 3.5.

How can I solve this problem?

1 Like

Maybe you should use cocos helper or SDK Box

They support more than one framework, I use cocos helper and it can works very well on android + ios. I never try SDK box but they also have google play services. Of course I recommend you to use cocos helper is open source and if you want to modify or add new feautures well you can do it :smiley:

So it means wrong include path :slight_smile: play with it.

try this one: https://github.com/SonarSystems/Cocos-Helper
it works for me with cocos2dx 3.8.1