Reputation: 1993
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 here) or updating the version of com.google.android.gms to 8.3.0.
I've done all the things I've found.
dependencies {
// This does not break the build when Android Studio is missing the JRebel for Android plugin.
classpath 'com.zeroturnaround.jrebel.android:jr-android-gradle:1.0.+'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
And in the app gradle
compile 'com.google.android.gms:play-services:8.4.0'
Upvotes: 197
Views: 88201
Reputation: 1095
Do the following:
Put the following in your build.gradle(Application level gradle file)
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta2'
classpath 'com.google.gms:google-services:2.0.0-beta2'
}
Please check here for latest version as this keep on changing.
Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable
Put the following line at the bottom of your build.gradle(module level gradle file)
apply plugin: 'com.google.gms.google-services
Upvotes: 15
Reputation: 3172
In my caseI have removed the "apply plugin: 'com.google.gms.google-services'" from the end of the gradle.build and its working fine.
Upvotes: 2
Reputation: 1386
I have updated in app build.gradle
dependencies {
....
compile 'com.google.android.gms:play-services-auth:9.0.0'
and app build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
}
Its working for.
Upvotes: 2
Reputation: 1539
This seems to be fixed with version 3.0.0 of Google Services plugin (and version 9.0.0 of the Google Play Services library). So with this
top level build.gradle
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
}
app level build.gradle
apply plugin: 'com.google.gms.google-services'
dependencies {
compile 'com.google.android.gms:play-services:9.0.0
}
Quick Side Note: If you are updating to version 3.0.0 of the google-services
plugin, make sure to regenerate your configuration file as it has new fields (explained here).
Edit (2016-06-20): While this does compile and run, I just noticed that in the build logs it does specify to put the plugin at the bottom of the file, or the default (9.0.0) will be used. So in the situation above this isn't a problem since I am using version 9.0.0, but this can be problematic when updating the dependency. Here's the log:
google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
Upvotes: 7
Reputation: 1414
For me works only this:
Top level.
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
}
App level:
dependencies {
compile 'com.google.android.gms:play-services-gcm:9.0.1'
compile 'com.google.android.gms:play-services-location:9.0.1'
}
// should be at the bottom
apply plugin: 'com.google.gms.google-services'
Upvotes: 5
Reputation: 21
There is no meaning in moving apply plugin: 'com.google.gms.google-services
' to the end of build.gradle. It is same as not defining it.
Just remove this line and make sure apply plugin: 'com.android.application
' is there
Use:
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
it will compile.
Upvotes: 1
Reputation: 17131
In project gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:2.0.0-alpha6'
}
}
in app/module gradle
apply plugin: 'com.google.gms.google-services'
android {
...
}
dependencies {
compile 'com.google.android.gms:play-services-analytics:8.3.0'
}
Upvotes: 0
Reputation: 21
I Was serching... at the Google page there is the solution...https://developers.google.com/android/guides/google-services-plugin#introduction
Add dependencies for basic libraries required for the services you have enabled. This step requires that the apply plugin: 'com.google.gms.google-services' line be at the end of your app/build.gradle file so that no dependency collisions are introduced. You can see the result of this step by running ./gradlew :app:dependencies.
Upvotes: 1
Reputation: 689
In the application's module (build.gradle)
Moving :
apply plugin: 'com.google.gms.google-services'
to the last line solved the issue.
Upvotes: 63
Reputation: 79
found in official example
in project gradle
// 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.0.0-alpha9'
classpath 'com.google.gms:google-services:2.0.0-alpha9'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
in app gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.google.samples.quickstart.signin"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
// Resolve dependency differences between app and tests
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.1.1'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
// Dependency for Google Sign-In
compile 'com.google.android.gms:play-services-auth:8.4.0'
// UiAutomatorTesting
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestCompile 'com.android.support:support-annotations:23.1.1'
}
apply plugin: 'com.google.gms.google-services'
Upvotes: 4
Reputation: 7415
The important thing is to set Gradle to Version 2.10
https://stackoverflow.com/a/35188079/570168
Upvotes: 1
Reputation: 481
Here is my instruction to fix it.
compile 'com.google.android.gms:play-services-location:8.3.0'
in app build.gradle
apply plugin: 'com.google.gms.google-services'
to the end of app build.gradle
classpath 'com.google.gms:google-services:2.0.0-alpha3'
in project build.gradle
dependency gradle-2.8
in gradle/wrapper/gradle-wrapper.properties
Upvotes: -3
Reputation: 3472
Use these dependencies for the project build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
}
and put this at the end of the app-level build.gradle file (after the dependencies).
apply plugin: 'com.google.gms.google-services'
I have no clue why putting this at the end (and not at the beginning ) solves the error.
EDIT 5/1/2016
Ok… So trying to put an end to all problems you guys have faced with my solution
This is my final app level gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "your-app-name"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:design:23.1.1'
compile 'com.mcxiaoke.volley:library:1.0.6@aar'
}
apply plugin: 'com.google.gms.google-services'
and this is my final project level gradle
// 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.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Compare this with your own gradle files, and add or modify any values which are different from what I've written.
Upvotes: 337