Google Play Services GCM 10.0.1 asks to “update” back to 9.0.0

21,027

Solution 1

Had this issue earlier today. Just apply the google services plugin before you apply the android application plugin.

Update the following lines:

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

to:

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

Solution 2

I had the same issue, I solved it looking for all the "build.grade" files in the project to change all the versions from 9.8.0 to 10.0.1 (you can do a search "find in path" to search the 9.8.0 string), I had one missing and this caused the error.

And also the line:

compile 'com.google.android.gms:play-services-appindexing:9.8.0'

must be replaced by:

compile 'com.google.firebase:firebase-appindexing:10.0.1'

Solution 3

To fix this you have to do the following.

First, even if the documentation says "Add this"

 dependencies {
        compile 'com.google.android.gms:play-services:10.0.1'
 }

Don't do it, because that is the whole google play services API, since version 6.5 if I remember correctly google play services is a selective API, it means that you must include only what you need.

Read this page entirely until you read Selectively compiling APIs into your executable.

Second, check that all your version numbers are the same, you can't mix them; check the link before, and choose only what you need.

By the way the class path is

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

Not beta-1 as @JuliaKo said.

P.S. If you speak Spanish, read my post about this here

Solution 4

In my case, check that not only google-play-services, but firebase services are of the same version as well.

Solution 5

Put this line after dependencies closure at the bottom:

apply plugin: 'com.google.gms.google-services'
Share:
21,027
JuliaKo
Author by

JuliaKo

Highly competent software engineer in search of full-time and contract work with clients seeking skilled and reliable digital transformation professionals Hands-on digital solutions designer covering healthcare, life sciences and financial services verticals. Wide scope of software engineering competencies including Native and Xamarin-based mobile applications for Android Platform, responsive web design using ASP.NET MVC + AngularJS, and adaptive web built with leading Digital Content Management platforms. Extensive knowledge of SDLC flavors including Agile, OpenUP, RUP and classic Waterfall.

Updated on July 15, 2022

Comments

  • JuliaKo
    JuliaKo almost 2 years

    I'm trying to build my new project, but I get this error:

    Error:Execution failed for task ':mobile: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 9.0.0.

    apply plugin: 'com.android.application'
    apply plugin: 'com.google.gms.google-services'
    
    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.1"
        defaultConfig {
            applicationId "com.julia.android.example_project"
            minSdkVersion 10
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        buildTypes.each {
            it.buildConfigField 'String', 'API_KEY', myKey
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:25.0.1'
        ...
        compile 'com.google.android.gms:play-services:10.0.1'
        compile 'com.google.android.gms:play-services-gcm:10.0.1'
        compile 'com.google.android.gms:play-services-location:10.0.1'
        wearApp project(':wear')
    }
    

    And

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.3'
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    I tried to move apply plugin: 'com.google.gms.google-services' at the bottom of my app/build.gradle file, but it didn't work out.

    Any ideas, please?

  • JuliaKo
    JuliaKo over 7 years
    @Fran, Yes, I did.
  • Pedro Varela
    Pedro Varela over 7 years
    This is no the solution to that problem. Read my answer
  • Pedro Varela
    Pedro Varela almost 7 years
    Latest class path is 'com.google.gms:google-services:3.1.0'
  • Chauyan
    Chauyan almost 7 years
    it works, but don't know why I can't find any explanation on google doc. it really sucks ..... btw, thanks a lot.