isGooglePlayServicesAvailable返回9

时间:2013-09-29 21:24:25

标签: java android google-maps

我的应用程序中有以下代码来启动Map View

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中不断重复消息:Google Play services is invalid. Cannot recover.

任何人都可以告诉我,我的错误是什么?

1 个答案:

答案 0 :(得分:5)

来自the documentation 9是Google Play服务的无效/不正确安装。

您是否确定从Play商店下载并更新了gps?