简体   繁体   English

Google Play游戏在Android版本中发生错误超时

[英]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. 我正在尝试简单地登录Google Play游戏服务并获得成就。 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. 我收到以下错误代码:DEBUG:启动Auth Transition。 OP: SIGN_IN status: ERROR_TIMEOUT. OP:SIGN_IN状态: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. 我敢肯定,我已经在开发者控制台中正确设置了它。

The code itself works. 代码本身有效。 The problem was that the google ad mobs API was implemented in the game already. 问题在于该游戏中已经实现了google ad mobs API。 Not sure but maybe they use the same services in google. 不确定,但也许他们在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. 删除插件,首先添加玩游戏插件,然后在开发控制台中配置应用程序,然后添加广告插件即可解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM