Adifyr
Adifyr

Reputation: 2679

Android Version Conflict for Google Services

I've searched for a lot of solutions to this, but none fit my exact case. I am getting this error on Gradle Sync:

Error:Execution failed for task ':app:processDebugGoogleServices'.

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.

this is in my build.gradle (app) dependencies.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    implementation 'com.google.firebase:firebase-auth: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'
}

and this is in my Project level build.gradle

buildscript {
    ext.kotlin_version = '1.2.10'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:3.1.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Also Important: It shows a red line under this line:

implementation 'com.google.firebase:firebase-auth:11.8.0'

The message I'm getting if I hover over it:

All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 11.8.0, 11.4.2. Examples include com.google.android.gms:play-services-auth:11.8.0 and com.google.firebase:firebase-analytics:11.4.2

I don't even have an analytics dependency!

What do I do?

Already tried solutions:

If I try to change my com.google.android.gms version, it will throw me a lint saying not to bundle my entire play services in the dependencies. And it also doesn't change the firebase error I'm getting.

Changing firebase to 11.4.2 will throw a lint error.

Changing google play services version to 3.1.1 or below will do nothing.

Upvotes: 4

Views: 11223

Answers (4)

Geethakrishna Juluri
Geethakrishna Juluri

Reputation: 540

If I am not wrong, Google services have the dependency on the firebase. I think both are conflicting

check this firebase.google.com/docs/android/setup and adjust google services and firebase dependency versions

Also, make sure you have this at the bottom of your build.gradle (app) file:

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

Upvotes: 6

praveen agrawal
praveen agrawal

Reputation: 21

Try changing it from 11.8.0 to 11.4.2 works for me. old values

implementation 'com.google.firebase:firebase-firestore:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'

new values

implementation 'com.google.firebase:firebase-firestore:11.4.2'
implementation 'com.google.firebase:firebase-auth:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'

Upvotes: 0

Febi M Felix
Febi M Felix

Reputation: 2839

You might have some third party library in your project using the com.google.firebase:firebase-analytics:11.4.2 version of Analytics. Try to find that.

Upvotes: 0

virendra singh deora
virendra singh deora

Reputation: 303

change this

 implementation 'com.google.firebase:firebase-auth:11.8.0'

to

compile'com.google.firebase:firebase-auth:11.8.0'

and make sure that in your applevel build.gradle all google and firebase dependency version should be the same.

it doesnt works try removing google dependency from applevel build.gradle

Upvotes: -4

Related Questions