Google play services out of date. Requires 5089000 but found 3136130

*爱你&永不变心* 提交于 2019-12-01 04:18:06

问题


I'm trying to use Google cloud messaging for an android app (Target name: Google APIs, platform: 4.3, API level: 18.

I implemented my GCM client by following the isntructions here: http://developer.android.com/google/gcm/client.html,

and setup play services by following the steps here: http://developer.android.com/google/play-services/setup.html#Setup, but still get the above error

Most of the solutions I've found on stack overflow redirect to the above two links, or suggest that we change the dependencies {} in the gradle settings, but I'm using eclipse and don't have gradle setup.

Update: Sorry yes I'm using the emulator and not a device

Any ideas?

Thanks!


回答1:


The final solution was creating a new emulator under Android 4.4.2, with the build target of the project set to Google APIs (x86 System Image). Thanks to Pedro Oliveira!




回答2:


If you need to provide an option for the user to update the google services you can do this:

   switch (isGooglePlayServicesAvailable(this)) {
        case 2: //out date
            try {
                GooglePlayServicesUtil.getErrorDialog(2, this, 0).show();
            } catch (Exception e) {
                e.printStackTrace();
            }
            break;

    }

This will prompt an update dialog for the user to update play services



来源:https://stackoverflow.com/questions/25809435/google-play-services-out-of-date-requires-5089000-but-found-3136130

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!