我正在 Wear Emulator 上测试 android wear 应用程序并使用 eclipse 进行开发。
在wear app的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();
当我在 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}
如果有人对此有解决方案或提示,请告诉我。
谢谢!
最佳答案
我相信我有同样的错误。
如果您的 build.gradle 是:
编译 'com.google.android.gms:play-services:+'
将其更改为:
编译 'com.google.android.gms:play-services:5.0.89'
那是因为谷歌并没有完全向设备推出最新的播放服务,但它已经可供开发者使用。 作为替代解决方案,您可以检查 SDK 管理器上的 WearEmulator 是否有更新。
关于Android Wear 模拟器显示 Google Play 服务错误 SERVICE_VERSION_UPDATE_REQUIRED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25685873/