【问题标题】:Google play services out of date [duplicate]谷歌播放服务过期[重复]
【发布时间】:2014-06-12 10:08:05
【问题描述】:

我正在尝试在我的应用程序中使用 Google Play 服务(在模拟器上)进行身份验证。

总是有错误:

  • Google play 服务已过期:需要 4323000,但找到 32651。

我曾尝试使用 Google API 在 4.3 和 4.4 模拟器中运行我的应用程序,但这并没有帮助。

【问题讨论】:

标签: android google-play-services


【解决方案1】:

您需要转到 Eclipse 中的 SDK 管理器并下载您尝试使用的 android 版本的 Google API。因此,在 android 4.4 选项卡下,您需要安装一个 Google APIs 包!在您需要的级别设置针对 Google API 的新 AVD 之后。

编辑: 在我的模拟器上检查后,谷歌 api 级别 19 确实可以在模拟器中使用谷歌地图,这意味着其他服务也可以。正常的4.4.2镜像抱怨google play服务过时了。

【讨论】:

  • Google API 与 Google Play SDK 不同
  • 实际上正如此处android-er.blogspot.co.uk/2013/07/… 所述,google api 包含用于模拟器的较新的 google play services apk。你必须在 avd 中定位 android 的 google play 图像
  • 所以我明白了。投票反转。感谢您添加该信息
【解决方案2】:

此答案仅与设备有关,与模拟器无关。转换为“社区 wiki”,因为它确实为设备提供了有用的信息。


该错误是来自 Google Play 服务的正常 ConnectionResult 错误之一。

您需要通过显示该ConnectionResult 的相应错误对话框来解决该错误。以下是在线文档中的一些示例代码:

.

/** Creates a dialog for the Google Play Services error. */
private void showErrorDialog(int errorCode)
{
    // DialogFragment.show() will take care of adding the fragment
    // in a transaction. We also want to remove any currently showing
    // dialog, so make our own transaction and take care of that here.
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    Fragment prev =
            getSupportFragmentManager()
                    .findFragmentByTag(GooglePlayDialogFragment.DIALOG_ERROR);
    if (prev != null)
    {
        ft.remove(prev);
    }
    ft.addToBackStack(null);

    // Create a fragment for the error dialog
    GooglePlayDialogFragment dialogFragment = new GooglePlayDialogFragment();
    // Pass the error that should be displayed
    Bundle args = new Bundle();
    args.putInt(GooglePlayDialogFragment.DIALOG_ERROR, errorCode);
    dialogFragment.setArguments(args);
    dialogFragment.show(ft, GooglePlayDialogFragment.DIALOG_ERROR);
}

GooglePlayDialogFragment 在内部处理许多升级错误,将用户引导至 Play 商店以更新 SDK。

【讨论】:

  • 我认为您可能误读了这个问题,因为它与模拟器有关,而不是在真实设备上使用应用程序
  • @CarbonAssassin thx 指出这一点 - 转换为社区 wiki,以防它增加任何价值,尽管与 OP 没有直接关系
猜你喜欢
  • 1970-01-01
  • 2014-08-18
  • 2014-05-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-28
  • 2014-11-20
  • 2015-05-08
相关资源
最近更新 更多