2

I am first time developer using Unity with Google Play Games Plugin including SignIn only. I went along the Unity Plugin Guide. Extracted error via logcat:

User cancelled sign in attempt in the previous attempt. Triggering callback with silentSignInResultCode
silentSignIn.OnFailure
Setting result error status code to 16
Result: False
SignInStatus: Canceled

Full output

27393 Info Unity Starting Auth with token client.
27393 Info Unity GooglePlayGames.Android.AndroidClient:Authenticate(Boolean, Action`1)
27393 Info Unity GameManager:Start()
27393 Info Unity 
27393 Info Unity  [Play Games Plugin 0.10.12] 08/03/21 9:33:26 +02:00 DEBUG: Activating PlayGamesPlatform.
27393 Info Unity System.Action:Invoke()
27393 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
27393 Info Unity 
27393 Info Unity  [Play Games Plugin 0.10.12] 08/03/21 9:33:26 +02:00 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
27393 Info Unity System.Action:Invoke()
27393 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
27393 Info Unity 
27393 Info Unity  [Play Games Plugin 0.10.12] 08/03/21 9:33:26 +02:00 DEBUG: Creating platform-specific Play Games client.
27393 Info Unity System.Action:Invoke()
27393 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
27393 Info Unity 
27393 Info Unity  [Play Games Plugin 0.10.12] 08/03/21 9:33:26 +02:00 DEBUG: Creating Android IPlayGamesClient Client
27393 Info Unity System.Action:Invoke()
27393 Info Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
27393 Info Unity 
27393 Debug HelperFragment Creating fragment
27367 Debug HelperFragment onResume called
27367 Debug SignInRequest signIn
27367 Debug SignInRequest Building client for: c5459e (a:false e:false i:false wc:  f: false)
27367 Debug SignInRequest canReuseAccount: true
27367 Debug SignInRequest lastSignedInAccount is null
27367 Debug SignInRequest signInClient.silentSignIn
27367 Debug SignInRequest silentSignIn.onFailure
27393 Debug   PlayerBase::stop() from IPlayer
27393 Debug AudioTrack stop(367): called with 288000 frames delivered
27367 Warn Activity Slow Operation: Activity my.package.name/com.unity3d.player.UnityPlayerActivity onPause took 66ms
27367 Warn ActivityThread handleWindowVisibility: no activity for token android.os.BinderProxy@bcff911
27367 Info Timeline Timeline: Activity_launch_request time:144715878
27367 Debug ForceDarkHelper updateByCheckExcludeList: pkg: my.package.name activity: com.google.android.gms.auth.api.signin.internal.SignInHubActivity@af6b802
27367 Info chatty uid=10409(my.package.name) identical 1 line
27367 Debug ForceDarkHelper updateByCheckExcludeList: pkg: my.package.name activity: com.google.android.gms.auth.api.signin.internal.SignInHubActivity@af6b802
27389 Info nture.unitygpg ProcessProfilingInfo new_methods=850 is saved saved_to_disk=1 resolve_classes_delay=8000
27367 Error **SignInRequest Setting result error status code to: 16**
27367 Info Unity Returning an error code.
27367 Info Unity GooglePlayGames.Android.<>c__DisplayClass18_0:<Authenticate>b__0(Int32)
27367 Info Unity System.Action`1:Invoke(T)
27367 Info Unity System.Action`1:Invoke(T)
27367 Info Unity System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
27367 Info Unity UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
27367 Info Unity UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
27367 Info Unity 
27367 Debug AudioManager getStreamVolume isRestricted mode = 0
27367 Debug HelperFragment onResume called
27367 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 }
27393 Debug AudioManager getStreamVolume isRestricted mode = 0
27393 Info Unity **Login Failed**

I tried using: PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptOnce/CanPromptAlways, (result) => { // => result = False } as well, but I get the same error code.

Source Code: https://gitlab.com/kronesbastian/unity-gpgs-plugin
Steps from a scratch project: https://justinmind-apps.gitbook.io/unity-using-gpgs-plugin/

Quick Data:
Windows 10
Unity 2020.3.15f2
Play Games Plugin for Unity 0.12.10
2D Mobile Android App
Minimum SDK: Android 10.0 (API Level 29) Android Mobile Phone: Xiaomi Redmi Note 8, connected via USB (has Android 10.0)

Tried following fixes:

  • Downgraded to another Unity Version 2020.3.14.
  • Checked SHA1s and certificates multiple times.
  • Used self managed keys by Google.
  • Started completly new projects from scratch, to eliminate other possible errors by my code.
  • Checked, my google cloud project is external, hence available for Google SignIn
  • Checked, I am a Internal Tester (added my Email individually and as a team)
  • Checked imported resource, rated by configuration of google play console which is implemented in unity GPGS Plugin
  • Checked, I uploaded always the most recent app which I downloaded on my device using Google Play
  • Firewall: Just have the default settings for Windows Defender

Anyone any idea why the signin doesn't work? Can anyone reproduce the same error?

Kind regards

  • I have this same error. Did you ever figure it out? – Lasse Sep 17 '21 at 10:21
  • Hey Lasse, indeed I solved the issue. I wrote a comprehensive guide how to implement it, while the issue was a very small part of it: Add the proper SHA1 keys (upload and app signing key) to each credential. – Bastian Krones Sep 18 '21 at 16:23

1 Answers1

3

To sommarize, it was a SHA1 issue. closely follow the steps I describe in a comprehensive guide using this plugin. Take attantion to the 2 steps adding 2 SHA1 (upload and app signing key to each credential).

Gitbook- Unity - Google Play SignIn