Java GooglePlayServicesAvailable返回9
我的应用程序中有以下代码来启动地图查看Java GooglePlayServicesAvailable返回9,java,android,google-maps,Java,Android,Google Maps,我的应用程序中有以下代码来启动地图查看 private boolean servicesOk() { int isAvailable = GooglePlayServicesUtil .isGooglePlayServicesAvailable(this); if (isAvailable == ConnectionResult.SUCCESS) { return true; } else if (GooglePlayService
private boolean servicesOk() {
int isAvailable = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(this);
if (isAvailable == ConnectionResult.SUCCESS) {
return true;
} else if (GooglePlayServicesUtil.isUserRecoverableError(isAvailable)) {
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(isAvailable,
this, GPS_ERRORDIALOG_REQUEST);
dialog.show();
} else {
Toast.makeText(this, "Connect Connect to Maps", Toast.LENGTH_SHORT)
.show();
}
return false;
}
但是在检查时,isAvailable
的值为9
,而且在LogCat
中,它不断重复的消息:googleplay服务无效。无法恢复。
有人能告诉我,我犯了什么错误吗?来自9的是一个无效/不真实的google play服务安装
您是否已确保从play store下载并更新了gps?是否在模拟器上运行此功能?是。。它会产生影响吗?请确保您运行的是谷歌API的API级别18,而不是Android 4.3(或类似的4.2和API级别17,等等)。我该如何更改它?在AVD管理器中,我只有一个选项
Android 4.3-API级别18
您能在这方面提供帮助吗?转到SDK manager.exe(与AVD管理器位于同一位置),在Android 4.3(API级别18)下,单击Google API旁边的复选框,然后单击底部附近带有Install 1软件包的按钮