[英]Android Wear Emulator show Error SERVICE_VERSION_UPDATE_REQUIRED for Google Play services
I am testing android wear app on Wear Emulator and using eclipse to develop. 我正在Wear Emulator上测试android wear应用,并使用eclipse开发。
In wear app there are code as below in onCreate: 在Wear应用中,onCreate中包含以下代码:
mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener()
{
@Override
public void onConnectionFailed(ConnectionResult result)
{
Log.d(TAG, "onConnectionFailed: " + result);
}
}).addApi(Wearable.API).build();
mGoogleApiClient.connect();
When I run this on Wear emulator I got error as below: 在Wear模拟器上运行此命令时,出现以下错误:
W/GooglePlayServicesUtil(1809): Google Play services out of date. Requires 5089000 but found 5077534
D/WearApp(1809): onConnectionFailed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null}
If any one have solution or tips for that then please let me know. 如果有任何解决方案或提示,请告诉我。
Thanks! 谢谢!
I believe I had the same error. 我相信我也有同样的错误。
If your build.gradle is: 如果您的build.gradle是:
compile 'com.google.android.gms:play-services:+'
change it to: 更改为:
compile 'com.google.android.gms:play-services:5.0.89'
that's because Google didn't completely roll out the latest play services to devices, but it's already available to developers. 这是因为Google并未完全向设备推出最新的播放服务,但开发人员已经可以使用它。 As an alternative solution, you can check if there's an update to the WearEmulator on the SDK Manager. 作为替代解决方案,您可以检查SDK Manager上的WearEmulator是否有更新。
If you look in your build.gradle file, you are probably using play-services. 如果您查看build.gradle文件,则可能正在使用播放服务。 You need to use play-services-wearable instead, which has the correct version. 您需要改用具有正确版本的play-services-wearable。
compile 'com.google.android.gms:play-services-wearable:+'
If you are using Eclipse, you need to ensure you unpack the play-services-wearable AAR file and not the standard mobile play-services AAR file. 如果使用的是Eclipse,则需要确保解压缩可穿戴播放服务的AAR文件,而不是标准的移动播放服务AAR文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.