Reputation: 3540
The latest Google Play Services version is 9.2.0 However Android emulator's Google Play Services is only 9.0.80
As a result, you cannot run an app compiled with 9.2.0 on the emulator. The MapView for example shows 'This app cannot run. Please update Google Play Services"
Any workaround other than changing app dependencies to 9.0.2?
Upvotes: 5
Views: 819
Reputation: 4950
Add Google Play Services to your project, add dependencies
for the latest version of play-services
.
apply plugin: 'com.android.application'
...
dependencies {
compile 'com.google.android.gms:play-services:9.2.0'
}
Be sure you update this version number each time Google Play services is updated.
As described in the Google Play services overview, Google Play delivers service updates for users on Android 2.3 and higher through the Google Play Store app. However, updates might not reach all users immediately, so your app should verify the version available before attempting to perform API transactions.
You are strongly encouraged to use the GoogleApiClient class to access Google Play services features. This approach allows you to attach an OnConnectionFailedListener
object to your client. To detect if the device has the appropriate version of the Google Play services APK, implement the onConnectionFailed()
callback method. If the connection fails due to a missing or out-of-date version of the Google Play APK, the callback receives an error code such as SERVICE_MISSING
, SERVICE_VERSION_UPDATE_REQUIRED or SERVICE_DISABLED.
Upvotes: -1