0

I'm trying to run one of the modules in the BasicSamples for Google Play Services. I have configured the app in the Game Services in the Developer Console including the OAuth2, package name, achievements, leaderboard etc. I have also updated Intellij SDK Manager to install Google Play Services and Google Repository. I've also updated the Take A Number app to include the application id and all the other ids.

However, when I try to run Take A Number I get the dialog:

"Install Google Play Games
This app requires the latest version of the Google Play Games app."

The documentation for setting up projects to use game services says to add

compile 'com.google.android.gms:play-services:10.0.1'

to build.gradle. I see these sample projects don't have that. So I tried adding it to build.gradle in TypeANumber but get the error:

 Error:Execution failed for task ':TypeANumber:dexDebug'.
> com.android.ide.common.process.ProcessException:     org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_92\bin\java.exe'' finished with non-zero exit value 2

I see BaseGameUtils build.gradle contains

compile "com.google.android.gms:play-services-games:${gms_library_version}"
compile "com.google.android.gms:play-services-plus:${gms_library_version}"

(but not com.google.android.gms:play-services).

I updated gms_library_version defined in top level BasicSamples' build.gradle to 10.0.1 and that didn't work either.

This is taking quite an effort to set this up. Any help is appreciated.

user6627139
  • 406
  • 6
  • 16
  • 2
    Does the emulator you're running have Google Play Games on it? The error reads like it's something the device is missing, not something your code is missing. Have you tried clearing the cache on your emulator? https://productforums.google.com/forum/#!msg/play/spbBeD2MKw8/8fenybSS3cYJ – BSMP Jan 09 '17 at 00:34
  • Thanks for the quick response. It does seem to be the device not the code. I was able to run it on my phone but not the emulator. I still get the error on the emulator even after clearing cache etc. Tried a different emulator, same thing. Noticed this in logs, not sure if relevant: StrictMode policy violation; ~duration=1003 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=65565 violation=1 – user6627139 Jan 09 '17 at 01:16
  • 1
    Looks like others have encountered this. Need to do some work to install play services on emulator. http://stackoverflow.com/questions/22141043/google-play-services-missing-in-emulator-android-4-4-2 – user6627139 Jan 09 '17 at 02:07

1 Answers1

1

The message `Install Google Play Games This app requires the latest version of the Google Play Games app.' indicates that the Play Games App is out of date compared to the client library version (10.0.1) you are using.

As the comments to your question indicate, if you are using an emulator, then the Play Store and other Google Apps will not be present, so you can't run the game on the Emulator, but only on devices that have the Google Play Services installed.

Clayton Wilkinson
  • 4,524
  • 1
  • 16
  • 25