Reputation: 567
I am attempting to utilize the Google Places API's PlacePicker in my Android app. However, whenever I attempt to create the picker, I receive the following error message:
Google Play services out of date. Requires 7095000 but found 6774470
Unfortunately, I am tied to testing on the emulator because I do not own a physical device. The emulator's image is API level 22 x86 with Google APIs target. Furthermore, I have attempted to include the Google Play Services library through the build.gradle file:
'com.google.android.gms:play-services:7.+'
Also, I have updated Google Play Services in the SDK Manager. What am I doing wrong? How can I update my Google Play services so I can use the Places API?
Upvotes: 28
Views: 31105
Reputation: 6245
my logcat is
Google Play services out of date. Requires 12210000 but found 11947270
so I changed the code of build.gradle
implementation 'com.google.android.gms:play-services-maps:12.0.0'
to
implementation 'com.google.android.gms:play-services-maps:11.0.0'
and it works
Upvotes: 0
Reputation: 2300
This is a workaround that I came up with since none of the solutions here worked for me. Also, I didnt want to update my code to use an older version of play services. I ended up installing the emulator with google play instead of google apis and then when the prompt came up I simply clicked update. This would take you to the google play store and all you have to do is update play services from there. Only caveat here is that this method requires you to sign in to the emulator with a google account. But for my use cases it was sufficient.
Upvotes: 0
Reputation: 3964
If the SDK Manager shows that you already have the latest version installed, you can simply duplicate your emulator definition.
The duplicated emulator will be loaded with the latest version of the SDK.
Upvotes: 10
Reputation: 7238
As others said, the reason is likely to be the Google Play installed in the AVD doesn't match dependency requirement. Besides the solutions suggested by others, I tried to lower my required Google Play version to 8.1 from 8.3, and the problem is solved.
Upvotes: 2
Reputation: 944
I only had this issue with the API 22 emulator. 21 and 23 were fine and I had no issues with physical devices.
I was curious to know whether or not this low version was critical for GCM, so modified the code to proceed anyway:
if (checkPlayServices()) {
// Start IntentService to register this application with GCM.
Intent intent = new Intent(this, ImpatientRegistrationIntentService.class);
startService(intent);
} else {<<-- Added this as a bypass as my emulator complained about versions
Intent intent = new Intent(this, ImpatientRegistrationIntentService.class);
startService(intent);
}
Interestingly, the API 22 emulator got a token from GCM and received downstream push messages without any problem.
Upvotes: 0
Reputation: 21
I had the same problem and right now I "updated" the version to 6774480 invalidating the caches and restarting, then i "downgraded" the dependecies compile 'com.google.android.gms:play-services:6+'
and it works, I know that is not a real solution but is a bad way to make it works so I can test my app
Upvotes: 2
Reputation: 370
I had the same issue, and had to move down to API 21 emulator image with google apps. That one is more up to date, and works.
Upvotes: 16
Reputation: 4121
Update your packages in Tools > Android > SDK Manager and then check all the packages in Extras that have an update available.
After you have done this use the following dependency in your (app) build.gradle
compile 'com.google.android.gms:play-services:7.3.0'
Upvotes: -1
Reputation: 135
I have a similar problem when I use Google-Play-services on android wear, then I solve it by updated my android wear app version. (because newer android wear version include newer Google-Play-services)
This problem cause by the version of Google-Play-services on your device is too old, you should update your version of Google-Play-services on your device.
For the emulator, you need to update Google-Play-services on your emulator instead of update your SDK.
Upvotes: 5