BaseGameUtils Gamehelper SingIn失败了

时间:2015-06-20 23:54:25

标签: android google-play-services

GameHelper代码的

LogCat

06-21 02:39:44.898: D/GameHelper(14315): GameHelper: Debug log enabled.
06-21 02:39:44.898: D/GameHelper(14315): GameHelper: Setup: requested clients: 1
06-21 02:41:59.378: D/GameHelper(19740): GameHelper: Debug log enabled.
06-21 02:41:59.378: D/GameHelper(19740): GameHelper: Setup: requested clients: 1
06-21 02:41:59.473: D/GameHelper(19740): GameHelper: beginUserInitiatedSignIn: resetting attempt count.
06-21 02:41:59.543: D/GameHelper(19740): GameHelper: Starting USER-INITIATED sign-in flow.
06-21 02:41:59.543: D/GameHelper(19740): GameHelper: beginUserInitiatedSignIn: starting new sign-in flow.
06-21 02:41:59.543: D/GameHelper(19740): GameHelper: Starting connection.
06-21 02:42:00.268: D/GameHelper(19740): GameHelper: onConnectionFailed
06-21 02:42:00.268: D/GameHelper(19740): GameHelper: Connection failure:
06-21 02:42:00.268: D/GameHelper(19740): GameHelper:    - code: SIGN_IN_REQUIRED(4)
06-21 02:42:00.268: D/GameHelper(19740): GameHelper:    - resolvable: true
06-21 02:42:00.268: D/GameHelper(19740): GameHelper:    - details: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{41c25018: android.os.BinderProxy@41c4a710}}
06-21 02:42:00.268: D/GameHelper(19740): GameHelper: onConnectionFailed: WILL resolve because user initiated sign-in.
06-21 02:42:00.268: D/GameHelper(19740): GameHelper: onConnectionFailed: resolving problem...
06-21 02:42:00.268: D/GameHelper(19740): GameHelper: resolveConnectionResult: trying to resolve result: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{41c25018: android.os.BinderProxy@41c4a710}}
06-21 02:42:00.268: D/GameHelper(19740): GameHelper: Result has resolution. Starting it.

1 个答案:

答案 0 :(得分:0)

在没有太多上下文的情况下,我猜你的问题在于需要处理从上一个日志行开始的活动的结果。该活动处理登录过程并将结果返回给您自己的Activity。你需要自己处理这个结果。 Google Play游戏教程中有一个示例:https://developers.google.com/games/services/android/init

在教程页面中搜索onActivityResult - 您需要在自己的Activity中覆盖此方法,如教程示例中所示。

其他一些背景信息:当您通过GoogleApiClient建立与Google Play游戏服务的连接时,该API会尝试对播放器进行身份验证。当玩家尚未登录游戏服务时,GameHelper会启动一个新的活动来处理登录过程。一旦此活动返回,您需要处理登录的结果。