Anton Logvinoff
Anton Logvinoff

Reputation: 43

Error "Please fix the version conflict either by updating the version of the google-services"

(translated with Google translator) I searched the Internet, everywhere people just change the version in build.gradle. Help me please. I'm ready to update the gms plugin, but how do I do this?

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 16.0.1.

My project gradle:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:3.1.1'
    }
}

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

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

My module gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:14'
    defaultConfig {
        applicationId "com.xxx.xxxxxxxx"
        minSdkVersion 14
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
}

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

Upvotes: 4

Views: 6498

Answers (4)

Vinvolv
Vinvolv

Reputation: 91

I had the same issue using ionic Cordova and fixed it by changing the GMS version in platforms/android/project.properties

 "cordova-plugin-google-analytics": {
      "GMS_VERSION": "VERSION_NUMBER_MENTIONED_IN_THE_BUILD_ERROR"

and in platforms/android/android.json

cordova.system.library.6=com.google.android.gms:play-services-analytics: VERSION_NUMBER_MENTIONED_IN_THE_BUILD_ERROR

Upvotes: 1

Peter Haddad
Peter Haddad

Reputation: 80952

Change this:

classpath 'com.google.gms:google-services:3.1.1'

into this:

classpath 'com.google.gms:google-services:4.0.1'

to avoid the mixing version error.

Also update the firebase-core dependency into this:

implementation 'com.google.firebase:firebase-core:16.0.1'

https://firebase.google.com/support/release-notes/android

Upvotes: 6

Arti Patel
Arti Patel

Reputation: 681

You can update versions of google libraries from this https://developers.google.com/android/guides/setup

Upvotes: 3

Abner Escócio
Abner Escócio

Reputation: 2785

Use as follow

dependencies {
    ...
    implementation 'com.google.firebase:firebase-core:15.0.0'
    ...
}

Upvotes: 0

Related Questions