Found com.google.android.gms:play-services:8.4.0, but version 8.3.0 is needed for the google-services plugin

AndroidGoogle MapsGoogle Play-Services

Android Problem Overview


Can't use google maps because of above said error. Anyone find the same issue ?

Android Solutions


Solution 1 - Android

Make sure that the following line is at the end of the app build.gradle file:

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

Mine was on the top and gradle was defaulting to 8.3.0 instead of what was specified: 8.4.0

My build.gradle files are the same as the ones in the Version conflict updating to 8.4.0

Solution 2 - Android

As those previous anweres are only part-wise complete. Here are my three steps which worked fine for me:

  1. Put this to the end of your apps build.gradle > apply plugin: 'com.google.gms.google-services'

  2. Set your projects build.gradle dependencies to > 'classpath 'com.google.gms:google-services:2.0.0-alpha5'

  3. Set Gradle Version to 2.10
    > Android Studio: File > Project Structure > Project

Solution 3 - Android

> @redsonic's answer worked for me.. By simply moving apply plugin: > 'com.google.gms.google-services' after the dependecies in > build.gradle (Module: app)

I'm using Android Studio 1.5.1 with Gradle version 2.10

In case you are using Gradle version older than 2.10 you'll also need to update that by selecting the ProjectName or app directory in the Project tool Windows and pressing F4. This will open Project Structure window, select Project from the menu and update Gradle version to 2.10. Press OK (Android Studio will download it in background).

build.gradle (Project: ProjectName)

dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
    classpath 'com.google.gms:google-services:2.0.0-alpha6'
}

build.gradle (Module: app)

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services:8.4.0'
}

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

Solution 4 - Android

This is a slight variant of @Lord Flash's answer:

For me it wasn't necessarily that I should place the google services plugin at the bottom of the file it was that it should come before the com.android.application plugin.

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

Also there are newer binaries than the alpha variants for google-services

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:2.0.0-beta6'
    }
}

I'm sure there will be newer ones soon. I found the list of variants here

Solution 5 - Android

follow all the steps at this link Add App Invites to Your App

use this : compile 'com.google.android.gms:play-services-appinvite:8.4.0'

instead of this : compile 'com.google.android.gms:play-services:8.4.0'

please follow all the steps and then build the project

hope thats help

Solution 6 - Android

I had the same problem, and I found that moving:

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

To the bottom of the module app gradle.

and then use:

classpath 'com.android.tools.build:gradle:2.1.0' classpath 'com.google.gms:google-services:2.1.0'

Solution 7 - Android

The problem is that some of your app dependencies that start with com.google.android.gms: have a version that is incompatible your project dependencie classpath 'com.google.gms:google-services:

Check for these on your app build.gradle

compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'

And for this in your project build.gradle

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

You can update your project build.gradle to use the latest google-services version or your can just change your app dependencies to use the 8.3 version.

Solution 8 - Android

// Top-level build file where you can add configuration options common to        all sub-projects/modules.

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

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

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

// this should solve the gradle update error if it persists even after following above steps

Solution 9 - Android

Make sure that the following line is at the end of the app build.gradle file:

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

google update there API day by day.Now mine is '11.0.2' try with the updated API

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionshijinView Question on Stackoverflow
Solution 1 - AndroidredochkaView Answer on Stackoverflow
Solution 2 - AndroidTobiasView Answer on Stackoverflow
Solution 3 - AndroidSuper AndroidView Answer on Stackoverflow
Solution 4 - AndroidGregView Answer on Stackoverflow
Solution 5 - AndroidAmer HadiView Answer on Stackoverflow
Solution 6 - AndroidBjqnView Answer on Stackoverflow
Solution 7 - AndroidRenato ProbstView Answer on Stackoverflow
Solution 8 - AndroidShailendra SinghView Answer on Stackoverflow
Solution 9 - AndroidShafayatBayezidView Answer on Stackoverflow