Search code examples
c#androidunity-game-enginegoogle-play-games

Error timeout by Google Play Games in android build


I'm trying to simply log into google play game services and the get a achievement. Here is the code :

using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
public class Achievements : MonoBehaviour {


    public static string testAch = " CgkI0PrljMcBEAIQAQ";
    public static  string testIncrAch = "CgkI0PrljMcBEAIQAg";
    // Use this for initialization
    void Start () {
        if (Application.platform == RuntimePlatform.Android)
        {
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();
            Social.localUser.Authenticate((bool success) =>
            {
                if (success)
                {
                    Debug.Log("Successes on login to google play games");


                    Social.ReportProgress(testAch, 100, (bool successAch) =>
                    {
                        //Ach unlocked 
                        Debug.Log("tEST AHC UNLOCKED");
                    });
                }
                else { Debug.Log("Login to google play games failed"); }
            });

            Social.ShowAchievementsUI();
        }
    }

    // Update is called once per frame
    void Update () {

    }
}

I'm getting the following error code : DEBUG: Starting Auth Transition. OP: SIGN_IN status: ERROR_TIMEOUT. It tries two times and the the auth failes. Any ideas why this is happening. I'm pretty sure I set it up in the developer console correctly.


Solution

  • The code itself works. The problem was that the google ad mobs API was implemented in the game already. Not sure but maybe they use the same services in google. Removing the plugins, adding the play games plugin first and configuring the app in the dev console and THEN adding the ads plugin solved the issue.