Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 尝试使用google游戏服务登录时出错_Java_Android_Google Play Services - Fatal编程技术网

Java 尝试使用google游戏服务登录时出错

Java 尝试使用google游戏服务登录时出错,java,android,google-play-services,Java,Android,Google Play Services,我正在尝试将google游戏服务集成到我的应用程序中,但在尝试使用测试帐户登录时出错。我已经按照他们的指示去做了。我的帐户是作为测试帐户添加的,签名是eclipse调试签名,正确添加了SHA1代码,我还仔细检查了我的客户机id,在我的代码和开发人员控制台上都正常 但它不起作用 这是我在日志中得到的信息: 05-28 16:46:53.402: W/dqi(20004): Authentication error: Unable to respond to any of these challen

我正在尝试将google游戏服务集成到我的应用程序中,但在尝试使用测试帐户登录时出错。我已经按照他们的指示去做了。我的帐户是作为测试帐户添加的,签名是eclipse调试签名,正确添加了SHA1代码,我还仔细检查了我的客户机id,在我的代码和开发人员控制台上都正常

但它不起作用

这是我在日志中得到的信息:

05-28 16:46:53.402: W/dqi(20004): Authentication error: Unable to respond to any of these challenges: {bearer=WWW-Authenticate: Bearer realm="https://www.google.com/accounts/AuthSubRequest", error=invalid_token}
05-28 16:46:53.402: E/Volley(20004): [1642] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/106672873966711781813
05-28 16:46:54.019: W/dqi(20004): Authentication error: Unable to respond to any of these challenges: {bearer=WWW-Authenticate: Bearer realm="https://www.google.com/accounts/AuthSubRequest", error=invalid_token}
05-28 16:46:54.019: E/Volley(20004): [1642] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/106672873966711781813
05-28 16:46:54.887: I/SBar.NetworkController(521): onReceive: WifiManager.RSSI_CHANGED_ACTION | WIFI_STATE_CHANGED_ACTION | NETWORK_STATE_CHANGED_ACTION Received
05-28 16:46:54.902: I/SBar.NetworkController(521): refreshSignalCluster: wifi: mWifiConnected=true Wifi=stat_sys_wifi_signal_4_fully Activity=stat_sys_wifi_inout Accessibility="Wi-Fi three bars."
05-28 16:46:55.355: W/dqi(20004): Authentication error: Unable to respond to any of these challenges: {bearer=WWW-Authenticate: Bearer realm="https://www.google.com/accounts/AuthSubRequest", error=invalid_token}
05-28 16:46:55.355: E/Volley(20004): [1645] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/106672873966711781813
05-28 16:46:55.965: W/dqi(20004): Authentication error: Unable to respond to any of these challenges: {bearer=WWW-Authenticate: Bearer realm="https://www.google.com/accounts/AuthSubRequest", error=invalid_token}
05-28 16:46:55.965: E/Volley(20004): [1645] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/106672873966711781813
05-28 16:46:56.285: D/ModemStatsService(12354): onSignalStrengthsChanged
05-28 16:46:56.285: D/ModemStatsService(12354): GSM, mRssi=-85
05-28 16:46:56.480: D/Tethering(433): interfaceLinkStateChanged wlan0, true
05-28 16:46:56.480: D/Tethering(433): interfaceStatusChanged wlan0, true
05-28 16:46:56.496: D/LSAPP_Beacon(11054): notifyAllCallers : notify caller POI=null caller:Handler (com.motorola.contextual.virtualsensor.locationsensor.LocationDetection$MessageHandler) {42942f38}
05-28 16:46:56.496: D/WifiScanReceiver(11831): intent.getAction(): android.net.wifi.SCAN_RESULTS
05-28 16:46:56.496: D/WifiScanReceiver(11831): Found 6 network(s) in scan
05-28 16:46:56.496: D/WifiIntentMapper(11831): isWifiLoggedIn: false
05-28 16:46:56.527: E/LSApp_App(11054): Sending Message to Handler (com.motorola.contextual.virtualsensor.locationsensor.LocationDetection$MessageHandler) {42942f38}: msg :1010002
05-28 16:46:56.535: E/SignInIntentService(20004): User has not completed registration.
05-28 16:46:56.535: E/SignInIntentService(20004): aol
05-28 16:46:56.535: E/SignInIntentService(20004):   at ajy.a(SourceFile:108)
05-28 16:46:56.535: E/SignInIntentService(20004):   at abm.a(SourceFile:213)
05-28 16:46:56.535: E/SignInIntentService(20004):   at abm.a(SourceFile:194)
05-28 16:46:56.535: E/SignInIntentService(20004):   at aav.a(SourceFile:486)
05-28 16:46:56.535: E/SignInIntentService(20004):   at aqu.a(SourceFile:221)
05-28 16:46:56.535: E/SignInIntentService(20004):   at com.google.android.gms.games.service.GamesSignInIntentService.onHandleIntent(SourceFile:343)
05-28 16:46:56.535: E/SignInIntentService(20004):   at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
05-28 16:46:56.535: E/SignInIntentService(20004):   at android.os.Handler.dispatchMessage(Handler.java:99)
05-28 16:46:56.535: E/SignInIntentService(20004):   at android.os.Looper.loop(Looper.java:137)
05-28 16:46:56.535: E/SignInIntentService(20004):   at android.os.HandlerThread.run(HandlerThread.java:60)

有人可以帮忙吗?

请尝试以下方法:

  • 与该用户一起登录plus.google.com,看看它是否有效。如果显示“注册Google+”屏幕,那是因为该用户没有启用Google+,因此无法登录游戏。这不应该发生(相反,用户应该在设备上看到Google+注册流)——我只是在这里彻底排除这种可能性

  • 如果游戏尚未发布,请确保用户出现在Google Play开发者控制台的测试人员列表中。要做到这一点,请转到Google Play开发者控制台,从列表中选择您的应用程序,转到测试选项卡,并确保将用户添加到测试人员列表中

  • 此外,请检查常见的嫌疑犯:

    • 客户端ID上的包名和证书指纹是否与应用程序上使用的包名和证书指纹匹配

    • 您是否在AndroidManifst.xml中包含游戏元数据标记


    CrazyWiz'解决方案对我来说并不是很好,但它给出了正确的提示。这是一个后端问题。我可以通过进入Google+应用程序管理页面(隐藏得很深)来解决这个问题:


    与我的游戏脱节。我不得不等一分钟。之后,我可以毫无问题地登录游戏。

    您是否查找了响应代码401的含义?错误是告诉您您的令牌无效。您还可以看到一条消息
    用户尚未完成注册
    。这可能是指您的测试帐户?你确定你已经完全创建了你的测试帐户,填写了个人资料并完成了任何电子邮件验证检查吗?是的,我在他们的样本中使用了相同的帐户,效果很好,我找不到响应代码401是什么意思人们会因为@CrazywizWiz不知道代码401代表什么而拒绝投票吗?不是每个人都知道这些事情。这就是问题的关键所在。我希望我能对这个问题投两次赞成票,因为它确实有一种超越“难道你不知道401是什么意思吗?”。play services库或play services API的服务器后端中存在错误。我在使用自己的G+帐户登录时遇到同样的问题。我妻子的G+账户确实有效,尽管使用的是我写的完全相同的应用程序。play services库自动处理身份验证和续订过期的身份验证令牌。整个图书馆基本上是一个黑匣子,藏着这些东西。因此,这个问题是完全合法的。看起来它确实与用户帐户有关,虽然它以前在他们的示例应用程序上工作过,但之后就不起作用了。因此,简而言之,我必须登录该帐户,之后它就工作了,尽管我没有修改任何重要的内容(我将帖子的可见性从私人改为公共),但据我所知,这似乎是他们的问题。谢谢你我不知道你是怎么发现的,但是。在我发布了一个应用程序之后,用户肯定不必这么做,对吧?@Clay我恐怕对此不太确定。去年,我就这个问题与Google Play开发者支持部门取得了联系,并告诉了他们解决方法。我的回答听起来很感激,好像这是一个已知的问题。他们还告诉我,他们会将这些信息传递给其他有问题的用户。我想说的是,你应该尝试从你的应用程序中处理错误,并显示一个弹出窗口,解释如何修复它。您还可以立即打开新的Google Play Games管理应用程序,使其变得更简单。这一个已经预装在很多当前设备上。我只是想为这个答案添加一个+1,我检查了又检查了签名和软件包名称,但没有结果。我唯一的猜测是,我最初没有正确配置某些东西,当它连接到Google+时,它导致错误不断抛出。一旦我“断开”它就工作了。