谷歌Android飞度onConnectionFailed()SIGN_IN_REQUIRED [英] Android Google Fit onConnectionFailed() SIGN_IN_REQUIRED

查看:878
本文介绍了谷歌Android飞度onConnectionFailed()SIGN_IN_REQUIRED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法避开这个问题。我只是无法登录。

我运行BasicSensorApi示例文件,它只是将无法连接。
看来我得到RESULT_CANCELED即使我在对话框中选择一个帐户?

下面是一个OnePlus运行我的logcat年底一4.4。

什么我需要做的任何想法?

(谷歌的控制台设置了net.xx',正确的SHA1,健身启用API。

  15 01-26:54:06.838 15678-15678 / net.xx D / dalvikvm:VFY:在更换运code 0x6e为0x0002
01-26 15:54:06.888 15678-15678 / net.xx I / BasicSensorsApi:准备就绪
01-26 15:54:06.898 15678-15678 / net.xx I / BasicSensorsApi:连接...01-26 15:54:07.008 15678-15678 / net.xx D / OpenGLRenderer:启用调试模式0
01-26 15:54:07.018 15678-15678 / net.xx I / BasicSensorsApi:连接失败。原因:ConnectionResult {状态code = SIGN_IN_REQUIRED,分辨率= {的PendingIntent 41c147e8:android.os.BinderProxy@41c14788}}
01-26 15:54:07.458 15678-15678 / net.xx I /时间轴:时间轴:Activity_idle ID:android.os.BinderProxy@418ce750时间:11713882
01-26 15:54:09.898 15678-15678 / net.xx I /时间轴:时间轴:Activity_idle ID:android.os.BinderProxy@418ce750时间:11716323


解决方案

如果你不是在你签署会得到一个回调 GoogleApiClient.OnConnectionFailedListener()通过在LogCat中信息中显示错误。如果您然后尝试使用来解决问题
result.startResolutionForResult(YourActivity.this,REQUEST_ code); 显示帐户选择对话框。听起来,我认为这是你已经走了多远。这是否正确?

一旦你在对话框中选择了一个帐户,您需要从另一个连接尝试的活动的的onActivityResult()。听起来像你对我可能会丢失这块code。

在一个侧面说明:如果这是你连接,你会在这一点得到另一个错误的第一次。解决一个会显示同意画面。如果用户接受了,你让另一个连接尝试,你应该成功地连接到API。

I can't seem to get round this issue. I just cannot sign in.

I'm running the BasicSensorApi sample file and it just will not connect. It seems i'm getting RESULT_CANCELED even though i select an account on the dialog?

Here is the end of my logcat running on a OnePlus One 4.4.

Any ideas on what i need to do?

(The Google console is set up with 'net.xx', correct SHA1, Fitness APi enabled.

01-26 15:54:06.838  15678-15678/net.xx D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
01-26 15:54:06.888  15678-15678/net.xx I/BasicSensorsApi﹕ Ready
01-26 15:54:06.898  15678-15678/net.xx I/BasicSensorsApi﹕ Connecting...

01-26 15:54:07.008  15678-15678/net.xx D/OpenGLRenderer﹕ Enabling debug mode 0
01-26 15:54:07.018  15678-15678/net.xx I/BasicSensorsApi﹕ Connection failed. Cause: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{41c147e8: android.os.BinderProxy@41c14788}}
01-26 15:54:07.458  15678-15678/net.xx I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy@418ce750 time:11713882
01-26 15:54:09.898  15678-15678/net.xx I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy@418ce750 time:11716323

解决方案

If you're not signed in you will get a callback to GoogleApiClient.OnConnectionFailedListener() with the error shown in your LogCat message. If you then try to resolve the problem using result.startResolutionForResult(YourActivity.this, REQUEST_CODE); the account selector dialog is displayed. Sounds to me that this is how far you've come. Is that correct?

Once you've selected an account in the dialog you need to make another connection attempt from your activity's onActivityResult(). Sounds to me like you might be missing this piece code.

On a side note: If this is the very first time you connect you will at this point get another error. Resolving that one will show the consent screen. If the user accepts, and you make yet another connection attempt you should be successfully connected to the API.

这篇关于谷歌Android飞度onConnectionFailed()SIGN_IN_REQUIRED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆