SirBif
SirBif

Reputation: 305

Run Google Play Services 5.0.89 on emulator

I'm trying to run an application using the latest Google Play Services (5.0.89 at the moment) on the android emulator, but every time I open it, I get the notification asking me to update G.P.S. I'm using a "Google API L18" AVD. And this is quite annoying if you're trying to run some espresso tests.

Apparently, it's a common problem that keeps plaguing android developers: https://code.google.com/p/android/issues/detail?id=57880

So far I've tried:

  1. just clicking ok -> but then I'm not connected to the services, which is bad
  2. switching to the Android L Preview AVD -> same problem
  3. downloading the G.P.S. apk from somewhere and trying to install it. Fails, since it's already present (and cannot be uninstalled)
  4. creating and AVD without G.P.S. and installing them manually. I get a "device not supported" error
  5. installing just a few packages (like this "adb -e install com.google.android.gms.apk) -> but I cannot find them for the 5.0.89 version
  6. in my application code, ignore the error returned by GooglePlayServicesUtil.isGooglePlayServicesAvailable -> the connection still fails (which means that simply not checking is not an option)
  7. UPDATE Trying to edit the value of GooglePlayServicesUtil.GOOGLE_PLAY_SERVICES_VERSION_CODE through reflection -> didnt't work (btw, yes I know it's an horrible hack, at this point it was more curiosity than anything else)

So, did anyone find a solution for this?

So far, the only option I can come up with to make it work is to delete my local copy of G.P.S. from the SDK tools, replace it with a previous version downloaded from somewhere (I haven't looked for it yet, but I'm pretty sure I'll be able to find some shady site providing it) and then rebuild my app. But this isn't something I'd like to do.

Upvotes: 2

Views: 706

Answers (1)

Wayne Piekarski
Wayne Piekarski

Reputation: 3232

If you go to the SDK Manager and check for updates, there should be an update for the API 19 system images. Have you tried updating to those and recreating the emulator and seeing if the problem persists?

Upvotes: 1

Related Questions