本文介绍了如何为Android Studio 2.2模拟器更新Google Play服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题有多种变体,但是大多数变体非常古老,根本无法真正回答该问题.我不是在问如何安装Studio 2.2模拟器中安装的Play服务.

There are a number of variations of this question, however most are very old, and don't really answer the question at all. I'm NOT asking how to install Play Services, that is installed in the Studio 2.2 emulators.

问题在于这些模拟器正在使用旧版本的Play服务.

The problem is that these emulators are using an old version of Play services.

当我运行使用Firebase方便Google登录的测试应用程序时,我会从Nexus 5 API 23仿真器收到此警告对话框:

When I run a test app that uses Firebase to facilitate Google login I get this alert dialog from a Nexus 5 API 23 emulator:

在我的登录活动的onCreate方法中,我有以下代码:

In the onCreate method of my login activity I have this code:

int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

    switch(result) {
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            Log.d(TAG,"SERVICE_VERSION_UPDATE_REQUIRED");
            break;
        case ConnectionResult.SUCCESS:
            Log.d(TAG, "Play service available success");
            break;
        default:
            Log.d(TAG, "unknown services result: " + result);

    }

这总是返回SERVICE_VERSION_UPDATE_REQUIRED.

This always returns SERVICE_VERSION_UPDATE_REQUIRED.

在警报对话框中单击更新无法执行任何检测到的操作.当Play服务启动失败时,我会在调试日志中收到以下消息:

Clicking update in the alert dialog does nothing that I can detected. In the debug log I get this message when Play Services startup fails:

W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9080000 but found 8489470

我的应用程序可以在真实的Android设备上正常运行.

My application runs fine on a real Android device.

我错过了什么简单的事情?

What simple thing am I missing?

TIA

推荐答案

现在这可能与该问题无关,但希望将其发布在此处以供将来的探索者使用,以便他们看到海底的一些土地.我一直在运行API 25并尝试Firebase通知的Nexus 5 x86模拟器上为过时的Google Play服务苦苦挣扎.我正在使用需要Google Play服务10.0.1的Firebase 10.0.1.但是在模拟器上,我总是习惯于获取消息

This may not be relevant to this question now, but wanted to post it here for future explorers, so that they see some land at the end of the sea. I had been struggling with this out of date Google Play Service on my Nexus 5 x86 emulator running API 25 and trying Firebase notification. I am using Firebase 10.0.1 which needs Google Play Services 10.0.1. But on my emulator, I always used to get the message

W/FA:服务连接失败:ConnectionResult {statusCode = SERVICE_VERSION_UPDATE_REQUIRED,分辨率=空,消息=空}

W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}

我已经广泛搜索了一种在模拟器上更新Google Play服务的方法,而无论提出什么建议都行不通.最后,我尝试创建一个新的仿真器Nexus 5 x86_64和API 24.它具有Google Play服务10.0.1,并且我的应用现在可以正常工作.

I had searched extensively a way to update the Google Play Services on my emulator, and whatever was suggested never worked. Finally, I tried creating a new emulator Nexus 5 x86_64 and API 24. Voila!!! It has Google Play Services 10.0.1 and my app works now.

令我震惊的是,为什么x86映像没有最新的Google Play服务,并且不允许我以任何方式更新它,而x86_64映像却具有最新的Google Play服务.

It really beats me why the x86 image does not have the latest Google Play Serviecs and it does not allow me to update it in any manner, while the x86_64 image has the latest Google Play Services.

希望这可以帮助那些在Google Play服务中苦苦挣扎的人.

Hope this helps someone struggling with Google Play Services.

这篇关于如何为Android Studio 2.2模拟器更新Google Play服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 12:21