Google Play Game Services Problem

  • MoseHas
    Likes 1

    Problem Description

    Hi there.

    After several days struggling, I finally succeeded building an apk for testing.

    However, I failed to call the gpgs function signin().

    Here is my code.

    #include "MenuScene.h"
    #include "MenuLayer.h"
    #include "Audio.h"
    #include "SimpleAudioEngine.h"
    #include "NativeUtils.h"
    
    using namespace CocosDenshion;
    
    bool MenuScene::init()
    {
    	if(!Scene::init())
    	{
    		return false;
    	}
    	NativeUtils::signIn();
    	log("--------------------------------------");
    	Audio::getInstance()->playBGM();
    	this->addChild(MenuLayer::create());
    
    	
    	return true;
    }
    

    It crashed immediately while I was entering the game. Did I do anything wrong?

    This is my logcat error log.

    06-16 18:17:07.755: E/AndroidRuntime(12108): FATAL EXCEPTION: main
    06-16 18:17:07.755: E/AndroidRuntime(12108): Process: com.MoseHas.Popstar, PID: 12108
    06-16 18:17:07.755: E/AndroidRuntime(12108): java.lang.UnsatisfiedLinkError: No implementation found for void org.cocos2dx.lib.Cocos2dxHelper.nativeSetApkPath(java.lang.String) (tried Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetApkPath and Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetApkPath__Ljava_lang_String_2)
    

     

  • Sonar Systems admin
    Likes 0

    Try using our Cocos Helper instead

     

    https://github.com/SonarSystems/Cocos-Helper


    This reply has been verified.
  • MoseHas
    Likes 0

    Thanks for the lib! I have tried to export the apk. It still crashed immediately. Here is my Logcat.

    Looks like it did not build my cocos2dx part? (couldn’t find cocos2dcpp.so)

  • MoseHas
    Likes 0

    Although I did not know how,  I solved it! 

    Now I can use gpgs in my game!

    All Hail Sonar System!

  • Sonar Systems admin
    Likes 0

    Great to hear, best if you use the Cocos Helper as that will recieve updates from us.

  • MoseHas
    Likes 0

    I do! Thank you very much.

  • Sonar Systems admin
    Likes 0

    Is that what you are using for this?

  • MoseHas
    Likes 0

    I used Calos’s api before but I could not successfully build.

    I did build my app using SonarCocosHelper.


    This reply has been verified.
  • barabasandras1
    Likes 0

    MoseHas, this problem occurs if you do not run build_native.py after importing your Cocos project (normally Eclipse should build it automatically but for some reason it won´t do for me either)


  • Sonar Systems admin
    Likes 0

    The helper is the one and only tool to help developers.

  • MoseHas
    Likes 0

    @barabasandras1 

    I got it. I finally pack my apk through console instead of eclipse’s export. I think you are right.


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    :D     

Login to reply