Google Play游戏集成除了弹出窗口外无所作为

问题描述

我正在使用 Unity 2020.2 Google Play服务插件版本0.10.11(最新)
当我在Android设备上构建并运行该应用程序时,它只会显示一个简单的弹出窗口,显示-“正在连接到Google Play游戏” ,然后什么也没有发生。它既未连接到Play游戏,也未显示任何错误...
我尝试检查Play控制台和开发者控制台中的所有内容,但一切似乎都很好,尝试了许多解决方案,但没有任何效果。请帮助,我真的很累。.

使用的脚本->

void Start()
        {
            Authenticate(); 
        }

public void Authenticate()
        {
            try {
                Debug.Log("Starting");
                PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
                Debug.Log("config made");
    
                PlayGamesPlatform.InitializeInstance(config);
                Debug.Log("Activated Instance");
                PlayGamesPlatform.Activate();
                Debug.Log("Activated Platform");
                PlayGamesPlatform.Instance.Authenticate((bool success) =>
                {
                    Debug.Log("Inside Authentication,Success = "+success);
                    if (success)
                    {
                        Debug.Log("Authenticated");
    
                    }
                    else
                    {
                        Debug.Log("Failed");
                    }
                }
                );
    
            }
            catch(Exception e)
            {
                Debug.Log("Error :---");
                Debug.Log(e);
            }
        }

以下是日志:(adb logcat):

11-02 14:40:42.499 19664 19679 I Unity   : Starting
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:42.499 19664 19679 I Unity   : GPGSManager:Authenticate()
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.Events.UnityAction:Invoke()
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.Events.UnityEvent:Invoke()
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.EventSystems.EventFunction`1:Invoke(T1,BaseEventData)
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject,BaseEventData,EventFunction`1)
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData,Boolean,Boolean)
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
11-02 14:40:42.499 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:Process()
11-02 14:40:42.499 19664 19679 I Unity   :
11-02 14:40:42.500 19664 19679 I Unity   : config made
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:42.500 19664 19679 I Unity   : GPGSManager:Authenticate()
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.Events.UnityAction:Invoke()
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.Events.UnityEvent:Invoke()
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.EventSystems.EventFunction`1:Invoke(T1,BaseEventData)
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject,EventFunction`1)
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData,Boolean)
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
11-02 14:40:42.500 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:Process()
11-02 14:40:42.500 19664 19679 I Unity   :
11-02 14:40:42.501 19664 19679 I Unity   : Activated Instance
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:42.501 19664 19679 I Unity   : GPGSManager:Authenticate()
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.Events.UnityAction:Invoke()
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.Events.UnityEvent:Invoke()
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.EventSystems.EventFunction`1:Invoke(T1,BaseEventData)
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject,EventFunction`1)
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData,Boolean)
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
11-02 14:40:42.501 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:Process()
11-02 14:40:42.501 19664 19679 I Unity   :
11-02 14:40:42.502 19664 19679 I Unity   : Activated Platform
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:42.502 19664 19679 I Unity   : GPGSManager:Authenticate()
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.Events.UnityAction:Invoke()
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.Events.UnityEvent:Invoke()
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.EventSystems.EventFunction`1:Invoke(T1,BaseEventData)
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject,EventFunction`1)
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData,Boolean)
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
11-02 14:40:42.502 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:Process()
11-02 14:40:42.502 19664 19679 I Unity   :
11-02 14:40:42.503 19664 19679 I Unity   : Starting Auth with token client.
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:42.503 19664 19679 I Unity   : GooglePlayGames.Android.AndroidClient:Authenticate(Boolean,Action`1)
11-02 14:40:42.503 19664 19679 I Unity   : GPGSManager:Authenticate()
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.Events.UnityAction:Invoke()
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.Events.UnityEvent:Invoke()
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.EventSystems.EventFunction`1:Invoke(T1,BaseEventData)
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject,EventFunction`1)
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData,Boolean)
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
11-02 14:40:42.503 19664 19679 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:Process()
11-02 14:40:42.503 19664 19679 I Unity   :
11-02 14:40:42.504 19664 19679 W Unity   : !!! [Play Games Plugin 0.10.11] 11-02-20 14:40:42 +05:30 WARNING: PlayGamesPlatform already initialized. Ignoring this call.
11-02 14:40:42.504 19664 19679 W Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:42.504 19664 19679 W Unity   : System.Action:Invoke()
11-02 14:40:42.504 19664 19679 W Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
11-02 14:40:42.504 19664 19679 W Unity   :
11-02 14:40:42.698 19664 19679 W Unity   : Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
11-02 14:40:42.698 19664 19679 W Unity   :
11-02 14:40:42.885 19664 19664 I Unity   : windowFocusChanged: false
11-02 14:40:42.885 19664 19664 I Unity   : onPause
11-02 14:40:42.919 19664 19679 D Unity   : Sensor :        Accelerometer ( 1) ; 0.019150 / 0.00s ; BMA255 Accelerometer/Temperature/Double-tap / BOSCH
11-02 14:40:48.213 19664 19664 I Unity   : windowFocusChanged: true
11-02 14:40:48.244 19664 19664 I Unity   : Returning an error code.
11-02 14:40:48.244 19664 19664 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:48.244 19664 19664 I Unity   : GooglePlayGames.Android.<>c__DisplayClass18_0:<Authenticate>b__0(Int32)
11-02 14:40:48.244 19664 19664 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.244 19664 19664 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.244 19664 19664 I Unity   : System.Reflection.MonoMethod:Invoke(Object,BindingFlags,Binder,Object[],CultureInfo)
11-02 14:40:48.244 19664 19664 I Unity   : System.Reflection.MethodBase:Invoke(Object,Object[])
11-02 14:40:48.244 19664 19664 I Unity   : UnityEngine.AndroidJavaProxy:Invoke(String,Object[])
11-02 14:40:48.244 19664 19664 I Unity   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy,IntPtr,IntPtr)
11-02 14:40:48.244 19664 19664 I Unity   :
11-02 14:40:48.247 19664 19664 I Unity   : onResume
11-02 14:40:48.257 19664 19679 D Unity   : Sensor :        Accelerometer ( 1) ; 0.019150 / 0.00s ; BMA255 Accelerometer/Temperature/Double-tap / BOSCH
11-02 14:40:48.280 19664 19679 D Unity   : Choreographer available: Enabling VSYNC timing
11-02 14:40:48.284 19664 19679 I Unity   : Inside Authentication,Success = False
11-02 14:40:48.284 19664 19679 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:48.284 19664 19679 I Unity   : GPGSManager:<Authenticate>b__5_0(Boolean)
11-02 14:40:48.284 19664 19679 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.284 19664 19679 I Unity   : System.Action`2:Invoke(T1,T2)
11-02 14:40:48.284 19664 19679 I Unity   : GooglePlayGames.<>c__DisplayClass33_0:<Authenticate>b__0(SignInStatus)11-02 14:40:48.284 19664 19679 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.284 19664 19679 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.284 19664 19679 I Unity   : System.Action:Invoke()
11-02 14:40:48.284 19664 19679 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
11-02 14:40:48.284 19664 19679 I Unity   :
11-02 14:40:48.286 19664 19679 I Unity   : Failed
11-02 14:40:48.286 19664 19679 I Unity   : UnityEngine.Logger:Log(LogType,Object)
11-02 14:40:48.286 19664 19679 I Unity   : GPGSManager:<Authenticate>b__5_0(Boolean)
11-02 14:40:48.286 19664 19679 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.286 19664 19679 I Unity   : System.Action`2:Invoke(T1,T2)
11-02 14:40:48.286 19664 19679 I Unity   : GooglePlayGames.<>c__DisplayClass33_0:<Authenticate>b__0(SignInStatus)11-02 14:40:48.286 19664 19679 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.286 19664 19679 I Unity   : System.Action`1:Invoke(T)
11-02 14:40:48.286 19664 19679 I Unity   : System.Action:Invoke()
11-02 14:40:48.286 19664 19679 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()

This is what is shows Ingame on Android device

解决方法

解决了: 我发现Google提供给我的SHA密钥不同于我的密钥库中的SHA密钥。 (可能是上传后的更改签名信息)
我刚刚为两个SHA密钥添加了登录凭据,并且它有效。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...