我是第一次使用 Unity 和 Google Play 游戏插件(仅包括登录)的开发人员。我按照Unity Plugin Guide进行了操作。通过 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
全输出
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**
我也尝试过使用:PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptOnce/CanPromptAlways, (result) => { // => result = False },但我得到了相同的错误代码。
源代码:https
:
//gitlab.com/kronesbastian/unity-gpgs-plugin 从头开始项目的步骤:https ://justinmind-apps.gitbook.io/unity-using-gpgs-plugin/
快速数据:
Windows 10
Unity 2020.3.15f2
Play Games Plugin for Unity 0.12.10
2D Mobile Android App
最低 SDK:Android 10.0(API 级别 29) Android 手机:小米 Redmi Note 8,通过 USB 连接(具有 Android 10.0)
尝试了以下修复:
- 降级到另一个 Unity 版本 2020.3.14。
- 多次检查 SHA1 和证书。
- 使用 Google 自行管理的密钥。
- 从头开始完全新的项目,以消除我的代码可能出现的其他错误。
- 检查,我的谷歌云项目是外部的,因此可用于谷歌登录
- 检查,我是一名内部测试员(单独和作为一个团队添加我的电子邮件)
- 检查导入的资源,通过在统一 GPGS 插件中实现的 google play 控制台的配置进行评级
- 检查,我总是上传我使用 Google Play 在我的设备上下载的最新应用程序
- 防火墙:只需使用 Windows Defender 的默认设置
有人知道为什么登录不起作用吗?任何人都可以重现相同的错误吗?
亲切的问候