Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Auth is getting cancelled when triggered #3003

Open
arijeetbaruah opened this issue Feb 10, 2021 · 14 comments
Open

Google Auth is getting cancelled when triggered #3003

arijeetbaruah opened this issue Feb 10, 2021 · 14 comments

Comments

@arijeetbaruah
Copy link

arijeetbaruah commented Feb 10, 2021

I am trying to login and Display the LeaderboardUI but getting stats 16.

Unity version: 2019.4.9f
plugin version: 0.10.11 (0x00001011)

Logcat logs:

2021/02/10 12:39:43.759 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 16 lines
2021/02/10 12:39:43.764 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.767 13362 13390 Info Unity is Auth: False
2021/02/10 12:39:43.767 13362 13390 Info Unity GoogleHandler:ShowLeaderboardUI()
2021/02/10 12:39:43.767 13362 13390 Info Unity UnityEngine.Events.UnityAction:Invoke()
2021/02/10 12:39:43.767 13362 13390 Info Unity UnityEngine.Events.UnityEvent:Invoke()
2021/02/10 12:39:43.767 13362 13390 Info Unity UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)
2021/02/10 12:39:43.767 13362 13390 Info Unity UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
2021/02/10 12:39:43.767 13362 13390 Info Unity UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
2021/02/10 12:39:43.767 13362 13390 Info Unity UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
2021/02/10 12:39:43.767 13362 13390 Info Unity UnityEngine.EventSystems.StandaloneInputModule:Process()
2021/02/10 12:39:43.767 13362 13390 Info Unity  
2021/02/10 12:39:43.767 13362 13390 Info Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021/02/10 12:39:43.767 13362 13390 Info Unity 
2021/02/10 12:39:43.767 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.768 13362 13390 Info Unity Starting Auth with token client.
2021/02/10 12:39:43.768 13362 13390 Info Unity GooglePlayGames.Android.AndroidClient:Authenticate(Boolean, Action`1)
2021/02/10 12:39:43.768 13362 13390 Info Unity GoogleHandler:ShowLeaderboardUI()
2021/02/10 12:39:43.768 13362 13390 Info Unity UnityEngine.Events.UnityAction:Invoke()
2021/02/10 12:39:43.768 13362 13390 Info Unity UnityEngine.Events.UnityEvent:Invoke()
2021/02/10 12:39:43.768 13362 13390 Info Unity UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)
2021/02/10 12:39:43.768 13362 13390 Info Unity UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
2021/02/10 12:39:43.768 13362 13390 Info Unity UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
2021/02/10 12:39:43.768 13362 13390 Info Unity UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
2021/02/10 12:39:43.768 13362 13390 Info Unity UnityEngine.EventSystems.StandaloneInputModule:Process()
2021/02/10 12:39:43.768 13362 13390 Info Unity  
2021/02/10 12:39:43.768 13362 13390 Info Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021/02/10 12:39:43.768 13362 13390 Info Unity 
2021/02/10 12:39:43.769 13362 13390 Debug SignInRequest signIn
2021/02/10 12:39:43.769 13362 13390 Debug SignInRequest Building client for: 216fe8 (a:true e:true i:true wc: 634844944540-nl1m0nu994am1r4d2dto8icf4dj34q4m.apps.googleusercontent.com f: false)
2021/02/10 12:39:43.770 13362 13390 Debug SignInRequest canReuseAccount: false
2021/02/10 12:39:43.770 13362 13390 Debug SignInRequest signInClient.silentSignIn
2021/02/10 12:39:43.771 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.776 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 128 + 64 err 0
2021/02/10 12:39:43.776 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(64) returned 64 = 64 + 0 err 0
2021/02/10 12:39:43.780 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.797 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 4 lines
2021/02/10 12:39:43.799 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.804 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.811 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 2 lines
2021/02/10 12:39:43.815 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.819 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 64 + 128 err 0
2021/02/10 12:39:43.819 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(128) returned 128 = 128 + 0 err 0
2021/02/10 12:39:43.823 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.835 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 3 lines
2021/02/10 12:39:43.839 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.843 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.847 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 1 line
2021/02/10 12:39:43.851 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.855 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.859 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.863 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.867 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 1 line
2021/02/10 12:39:43.871 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.875 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.879 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.883 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 1 line
2021/02/10 12:39:43.887 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.891 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.895 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.899 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.904 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 128 + 64 err 0
2021/02/10 12:39:43.904 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(64) returned 64 = 64 + 0 err 0
2021/02/10 12:39:43.907 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.912 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.916 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.920 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.928 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 2 lines
2021/02/10 12:39:43.932 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.935 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.941 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 1 line
2021/02/10 12:39:43.944 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.948 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 64 + 128 err 0
2021/02/10 12:39:43.948 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(128) returned 128 = 128 + 0 err 0
2021/02/10 12:39:43.952 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:43.956 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.023 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 17 lines
2021/02/10 12:39:44.027 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.031 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 128 + 64 err 0
2021/02/10 12:39:44.031 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(64) returned 64 = 64 + 0 err 0
2021/02/10 12:39:44.036 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.067 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 8 lines
2021/02/10 12:39:44.072 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.076 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 64 + 128 err 0
2021/02/10 12:39:44.076 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(128) returned 128 = 128 + 0 err 0
2021/02/10 12:39:44.081 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.151 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 18 lines
2021/02/10 12:39:44.155 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.159 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 128 + 64 err 0
2021/02/10 12:39:44.159 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(64) returned 64 = 64 + 0 err 0
2021/02/10 12:39:44.164 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.167 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.171 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.176 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.180 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.187 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 2 lines
2021/02/10 12:39:44.191 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.194 13362 13362 Debug SignInRequest silentSignIn.onFailure
2021/02/10 12:39:44.195 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.199 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.203 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 64 + 128 err 0
2021/02/10 12:39:44.203 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(128) returned 128 = 128 + 0 err 0
2021/02/10 12:39:44.207 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.227 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 5 lines
2021/02/10 12:39:44.231 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:44.234 13362 13390 Debug   PlayerBase::stop() from IPlayer
2021/02/10 12:39:44.234 13362 13390 Verbose AudioTrack stop(176): prior state:STATE_ACTIVE
2021/02/10 12:39:44.234 13362 13390 Debug AudioTrack stop(176): called with 453120 frames delivered
2021/02/10 12:39:44.234 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 0 = 0 + 0 err -4
2021/02/10 12:39:44.252 13362 13362 Warn ActivityThread handleWindowVisibility: no activity for token android.os.BinderProxy@fb48ca6
2021/02/10 12:39:48.680 13362 13362 Error SignInRequest Setting result error status code to: 16
2021/02/10 12:39:48.716 13362 13362 Info Unity Returning an error code.
2021/02/10 12:39:48.716 13362 13362 Info Unity GooglePlayGames.Android.<>c__DisplayClass18_0:<Authenticate>b__0(Int32)
2021/02/10 12:39:48.716 13362 13362 Info Unity System.Action`1:Invoke(T)
2021/02/10 12:39:48.716 13362 13362 Info Unity System.Action`1:Invoke(T)
2021/02/10 12:39:48.716 13362 13362 Info Unity System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
2021/02/10 12:39:48.716 13362 13362 Info Unity UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
2021/02/10 12:39:48.716 13362 13362 Info Unity UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
2021/02/10 12:39:48.716 13362 13362 Info Unity  
2021/02/10 12:39:48.716 13362 13362 Info Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021/02/10 12:39:48.716 13362 13362 Info Unity 
2021/02/10 12:39:48.719 13362 13362 Debug HelperFragment onResume called
2021/02/10 12:39:48.742 13362 13390 Verbose AudioTrack start(176): prior state:STATE_STOPPED
2021/02/10 12:39:48.742 13362 13390 Verbose AudioTrack start(176): server read:-62726592  cumulative flushed:0  client written:452928
2021/02/10 12:39:48.743 13362 13362 Verbose MediaRouter Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
2021/02/10 12:39:48.756 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 1536 = 192 + 1344 err 0
2021/02/10 12:39:48.757 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 1344 = 192 + 1152 err 0
2021/02/10 12:39:48.757 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 1152 = 192 + 960 err 0
2021/02/10 12:39:48.757 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 960 = 192 + 768 err 0
2021/02/10 12:39:48.757 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 768 = 192 + 576 err 0
2021/02/10 12:39:48.757 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 576 = 192 + 384 err 0
2021/02/10 12:39:48.757 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 384 = 192 + 192 err 0
2021/02/10 12:39:48.757 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:48.801 13362 13390 Error Unity Auth Failed
2021/02/10 12:39:48.801 13362 13390 Error Unity System.Action`1:Invoke(T)
2021/02/10 12:39:48.801 13362 13390 Error Unity System.Action`2:Invoke(T1, T2)
2021/02/10 12:39:48.801 13362 13390 Error Unity GooglePlayGames.<>c__DisplayClass33_0:<Authenticate>b__0(SignInStatus)
2021/02/10 12:39:48.801 13362 13390 Error Unity System.Action`1:Invoke(T)
2021/02/10 12:39:48.801 13362 13390 Error Unity System.Action`1:Invoke(T)
2021/02/10 12:39:48.801 13362 13390 Error Unity System.Action:Invoke()
2021/02/10 12:39:48.801 13362 13390 Error Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
2021/02/10 12:39:48.801 13362 13390 Error Unity  
2021/02/10 12:39:48.801 13362 13390 Error Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021/02/10 12:39:48.801 13362 13390 Error Unity 
2021/02/10 12:39:48.818 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:48.827 13362 13426 Info chatty uid=10455(com.ArijeetBaruah.TelKhuta) AudioTrack identical 2 lines
2021/02/10 12:39:48.832 13362 13426 Verbose AudioTrack processAudioBuffer(176): obtainBuffer(192) returned 192 = 192 + 0 err 0
2021/02/10 12:39:48.833 13362 13390 Info Unity  [Play Games Plugin 0.10.11] 02/10/21 12:39:48 +05:30 DEBUG: Authentication canceled
2021/02/10 12:39:48.833 13362 13390 Info Unity System.Action:Invoke()
2021/02/10 12:39:48.833 13362 13390 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
2021/02/10 12:39:48.833 13362 13390 Info Unity  
2021/02/10 12:39:48.833 13362 13390 Info Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2021/02/10 12:39:48.833 13362 13390 Info Unity 

My code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SocialPlatforms;
using System;
using GooglePlayGames.BasicApi;
using GooglePlayGames;
using UnityEngine.Events;

public class GoogleHandler : MonoBehaviour
{
    PlayGamesClientConfiguration config;

    public static GoogleHandler handler = null;

    public UnityEvent OnGoogleLogin;

    [System.Serializable]
    struct AchievementListItem
    {
        public string id;
        public string achievementIDs;
    }

    [SerializeField] List<AchievementListItem> achievementIDs = new List<AchievementListItem>();

    // Start is called before the first frame update
    void Awake()
    {
        if(handler == null)
        {
            handler = this;
            DontDestroyOnLoad(gameObject);
            SetUpGoogle();
        }
        else
        {
            Destroy(gameObject);
        }
    }

    void SetUpGoogle()
    {
        config = new PlayGamesClientConfiguration.Builder()
        .RequestEmail()
        .Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

        PlayGamesPlatform.Instance.Authenticate((bool success) =>
        {
            if (success)
            {
                Debug.Log(displayName);
                OnGoogleLogin.Invoke();
            }
            else
            {
                Debug.LogError("Auth Failed");
            }
        });

        //ShowAchievements();
    }

    public string displayName
    {
        get { return PlayGamesPlatform.Instance.GetUserDisplayName(); }
    }

    public void ShowLeaderboardUI()
    {
        Debug.Log($"is Auth: {PlayGamesPlatform.Instance.localUser.authenticated}");
        if (PlayGamesPlatform.Instance.localUser.authenticated)
        {
            Debug.Log($"is Auth: {displayName}");

            Social.ShowLeaderboardUI();
        }
        else
        {
            PlayGamesPlatform.Instance.Authenticate((bool success) =>
            {
                if (success)
                {
                    Debug.Log(displayName);
                    OnGoogleLogin.Invoke();
                }
                else
                {
                    Debug.LogError("Auth Failed");
                }
            });
        }
    }

    public void CompleteAchievement(string ID)
    {
        Social.ReportProgress(ID, 100f, (bool sucess) =>
        {
            print(sucess);
        });
    }
}
@Voresh
Copy link

Voresh commented Feb 12, 2021

I got the same problem.

@arijeetbaruah
Copy link
Author

arijeetbaruah commented Feb 13, 2021

min Version API level: Andriod 9.0
target API level: Highest installed (SDK 30)

In my case

@moldovev
Copy link

In my case the problem was that I had Anti-Piracy Enabled.

To turn it off go to Google Play Console
Select app -> Play Games Services -> Setup and Management -> Configuration -> Credentials (Android) -> Edit -> Enable anti- piracy OFF

@chico-barnstorm
Copy link

chico-barnstorm commented Feb 25, 2021

We've been experiencing the same recently, for a few days too - in our case it does happen for [new apps pointing to new Google Cloud projects] as well as [new apps pointing to existing and fully working Google Cloud projects].

We've checked many, many times our setup and all looks fine: credentials/SHA1 fingerprints for the Upload and App signing key certificates, testers, tracks and Google Cloud setup. All absolutely fine. Yet we keep getting the confusing "error 16".

  • We're using Unity2018.4.32f1, with the latest version of the plugin (0.10.12).
  • Min API Level: 16
  • Target API Level: 30 (Highest Installed)
  • No Anti-Piracy enabled

@ChuckWalters
Copy link

GooglePlayGames/BasicApi/CommonStatusCodes.cs
///

The result was canceled either due to client disconnect or cancel().
Canceled = 16,
If there's no logic to auto trip cancel and network is not faulty, then I'd look at where the call is made. Calling leaderboard from inside a callback can be problematic.

@cometa93
Copy link

We have the same problems,
we are also using "EnableSavedGames"

@payini
Copy link

payini commented Apr 7, 2021

I get the same error.

@sanook8899
Copy link

I get the same error.

Do you fix it?

@sicklydove
Copy link

We are also experiencing this, will update if I find a fix.

@quanarmy
Copy link

Same problem :(

@sicklydove
Copy link

sicklydove commented Apr 27, 2021

Alright, so this cost me about two full days of dev time.

In the end, it was because the OAuth consent screen had User type set to 'Internal', and the Google account I was using for testing was not managed by the company in question. For small organisations I think it's generally easiest to always use 'External' here, and just add email addresses for testing/development - especially if using contractors.

Anyway, after lots of back-and-forth I found the best way to debug it was with the Android monitor which can be found in the tools directory of your JDK. The native SDK writes a lot of extra logging information here, which unfortunately doesn't reach Unity. Once you have monitor running, and your device attached, try filtering the logs for Errors, or with the query tag:PlayGames. In my case, it did actually point me in the right direction.

It should look a bit like this.
image

Here are some of the other things I learned along the way, in the hope they help someone else:

  • This response is a very generic 'catch-all' that covers a large number of possible error cases, several of which are misconfiguration. This is particularly unhelpful, as 'cancelled' would, to me, imply a fairly specific situation. Apparently not, oh well.
  • If you are building straight from Unity and loading onto a device via USB cable, make sure that the fingerprint of the attached Android Credential in the Google Play Console is the SHA-1 fingerprint of the local keystore you are using to build in unity. do not make a development build; this will be signed with a different keystore. In the Google Play Console, this fingerprint should be the same as that of your 'Upload key certificate' listed on App Integrity.
  • You can double-check that the fingerprint of the .apk matches that of the Upload key certificate by unzipping the apk, and running the following command keytool -printcert -file /path/to/unzipped/apk/META-INF/CERT.RSA
  • If you are building from Unity, uploading the apk to Google Play Services, and then downloading the APK from the Play store onto your phone, the SHA-1 fingerprint of the attached credential should not be that of of your local keystore, instead, it should be the fingerprint of the 'App signing key certificate' listed in App Integrity. This is because Google Re-signs your app with their own key stored on their servers, before pushing it up to Google Play.
  • Make sure that the Google Play Games user you are attempting to log in with is listed as a Test User in your OAuth consent screen, as well as in the Console.

@agneisilva
Copy link

I'm facing this problem yet...

@bcmccracken
Copy link

Thank you @sicklydove, your tips were very helpful! I noticed that monitor is officially deprecated in Android Studio 3.1 and being removed from Android Studio 3.2, but adb logcat will provide similar results. My problem is that I was formerly running adb logcat -s Unity to filter those down to Unity logs, but most of the useful logs aren't Unity, and many of them also don't have the PlayGames tag mentioned. PlayerAgent was the tag for the log entry that was most useful to me, pictured here:
googleAuthMonitorEdit
I hadn't yet published my Play Games Configuration in the Play Games Console, as it warned that some changes to the game wouldn't be possible after publishing, and leaderboards and achievements couldn't be deleted. But that was my issue--the configuration couldn't be found, and that was causing the auth issue.

@kuoliangkwong
Copy link

I had the same issue but managed to fix it by adding my testing account in Play console.
image

It was still throwing error after adding the account until I cleared app data for Play Store, Play Services, Play Games apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests