糟糕:尝试从 helloAuthentication Android 示例应用程序“Ping Bluemix”时出现问题

问题描述 投票:0回答:1

借助此论坛的帮助,我终于能够运行“bms-samples-hellotodo-advanced”,它使用 MCA 和 Facebook 身份验证。

我仍然对“bms-samples-helloauthentication”不满意,它使用 MCA 和 Google 身份验证。

我正在使用 Genymotion 模拟器使用 Android Studio 进行构建和调试。 我正在遵循这些说明:

一切都会构建,没有警告或错误。我能够成功启动应用程序。

但是当我单击“Ping Bluemix”时,应用程序显示:

Bummer: something went wrong

  • 我没有看到 Google 登录对话框

  • 我在 Logcat 中没有看到任何错误或警告

  • 调试器显示我已经通过了

    pingBluemix() > new Request(BMSClient.getInstance().getBluemixAppRoute() + "/protected", Request.GET).send(this, this);

  • 但是我从来没有点击过 onActivityResult(),所以我从来没有机会打电话

    GoogleAuthenticationManager.getInstance().onActivityResultCalled()

  • cf 日志 helloAuthentication2 显示:

    2016-04-06T23:28:51.97-0700 [App/0] OUT [2016-04-07 06:28:51.971] [ERROR] [default] - Missing authorization

如何排查并解决此问题?

有什么方法可以对运行 Android 应用程序的 MCA/Google 身份验证独立进行故障排除吗?

android google-oauth ibm-cloud ibm-mobile-services
1个回答
3
投票

非常感谢上面的 James Young:

  1. 不,我的 Genymotion 模拟器没有安装了 Google Play 服务。这就是问题所在。

  2. 安装 Google Play 服务:

    a) 单击浏览器

    b) 搜索 Google Play 服务 apk

    c) 从 Google Play 安装(理想)或

    d) 在 apkmirror.com 上选择版本并手动安装

  3. 安装 Google Play 服务后,“一切正常”。当我单击“Ping Bluemix”时,我收到一个用于 Google 登录的对话框,并且成功地通过 Bluemix 进行身份验证。

再次感谢你,詹姆斯!

© www.soinside.com 2019 - 2024. All rights reserved.