检查谷歌播放服务突然返回无效

时间:2013-09-07 06:36:30

标签: android google-play-services

我正在开发一个位置感知的Android应用程序,它一直运行良好,直到今天。在进行一些修改并尝试在我的设备中重新运行应用程序后,它会在检查Google Play服务时突然返回SERVICE_INVALID(错误代码9)。

private boolean isGooglePlay(){
    int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    Toast.makeText(getApplicationContext(), ""+status, Toast.LENGTH_SHORT).show();

    if(status == ConnectionResult.SUCCESS){
        return true;
    }
    else{
        ((Dialog) GooglePlayServicesUtil.getErrorDialog(status, this, 10)).show();
        return false;
    }
}

提前致谢

1 个答案:

答案 0 :(得分:0)

使用最新的google-play-service库要求您使用Google API中的真实设备或模拟器图片,而不是x86 Google API(Google Inc.)API级别19 代替 Android 4.4 - API级别19 您可以在developer网站

上找到解释
To test your app when using the Google Play services SDK, you must use either:

A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

在将图像切换到Google API之前,我遇到了同样的错误并修复了它。