4

I'm trying to include Firebase in my Android project. Running it, throws me this error:

Google Play services out of date.  Requires 11910000 but found 11577470

I found several links about this here, most of them saying to downgrade to:

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

This doesn't work for me anymore, because I use SDK 26 and it throws incompatibilities errors with other libraries.

Here are my gradle files: (Module):`

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
    classpath 'com.google.gms:google-services:3.1.1'
}

`App:

android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.example.project"
    minSdkVersion 24
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.android.gms:play-services:11.8.0'

} apply plugin: 'com.google.gms.google-services'

And as you can see here my Google Services is updated as well.

In my log I get these errors:

I/FirebaseCrash: Sending crashes
W/FirebaseInstanceId: No response
E/FirebaseInstanceId: Topic sync failed: TIMEOUT
E/FirebaseInstanceId: Topic sync failed: SERVICE_NOT_AVAILABLE
W/FirebaseInstanceId: No response
E/FirebaseInstanceId: Topic sync failed: TIMEOUT

Does anyone know how I could resolve this problem? Any tips are appreciated. Thanks.

user1888492
  • 51
  • 1
  • 4

2 Answers2

0

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.

0

It means that the Play Services APK on your device is older than the version you requested in your app.

If this is an emulator, you'll want to use the ones with "Google Play" in their names, not "Google APIs." The latter are always behind schedule and require a full image update to get the latest Play Services version whereas the former give you the Play Store which will update Play Services for you. If this is a device, make to update this app.

BTW, you should be showing a notification or dialog in your app if Play Services isn't available. See how to check for availability.

SUPERCILEX
  • 3,929
  • 4
  • 32
  • 61
  • I already used everything with Google Play? At least the updates in the sdk manager. I updated the other Google Play services( Licensing library and APK Expansion library) but still same errors – user1888492 Jan 02 '18 at 12:43
  • No, you've got to update Play Services on the device or emulator. – SUPERCILEX Jan 02 '18 at 18:14