I get an error saying
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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
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
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
You need to put the apply plugin: 'com.google.gms.google-services' line below your dependencies block - this allows the plugin to determine what version of Play services you are using.
If you have firebase dependencies. Update their version to match version of google services:
Example:
//Firebase Crashreports
compile 'com.google.firebase:firebase-crash:9.6.1'
//Firebase Analytics
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
All must have same 9.6.1 version
just write this after dependencies
apply plugin: 'com.google.gms.google-services'
Do you have the line
apply plugin: 'com.google.gms.google-services'
line in the end of you build.gradle file?
This error came mostly when "apply plugin" put at the top.
I run into the same problem.
My solution was not to add anything to the code but download
Google Support Repository - you can find it in Tools
-> Android -> SDK Manager -> SDK Tools
Just apply the google-services below the dependencies.
worked for me.
I was facing similar problem.At the top when the plugin is added it did not work for me.so Add the plugin at the bottom of the gradle.
this solve my problem of conflict Version
apply plugin: 'com.google.gms.google-services'
and add it dependency these lines
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
I installed Google Repository:
Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
Just go to /platforms/android/cordova-plugin-fcm/*-FCMPlugin.gradle
find for
classpath 'com.google.gms:google-services:+'
replace it with
classpath 'com.google.gms:google-services:3.0.0'
build again.
This is problem is actually take my lot of time, however I solved it by applying the plugin com.google.gms.google-services.
Important: Make sure to don't use it at the top of the gradle file, and use it after the block of dependencies.
Related
I have an android app that I want to add firebase messaging service functionality so I can receieve notifications that are sent from my self-built server to the firebase cloud.
I started adding the configuration lines to the gradle files, but after adding the
apply plugin: 'com.google.gms.google-services'
line, I get an error as follows:
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.0.2.
This is my module:app gradle script file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "br.com.berait.brecar"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.gms:play-services-maps:11.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.android.support:design:25.3.1'
compile 'com.wdullaer:materialdatetimepicker:3.2.2'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.7'
compile 'com.google.firebase:firebase-messaging:10.2.6'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
if needed, this is my project level gradle script file:
//Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have searched S.O for sometime now and all the answers to this type of error haven't worked for me. As you can see, i have the apply plugin line at the bottom of the file. I believe the conflict is being generated by the
compile 'com.google.android.gms:play-services-maps:11.0.2'
line, which was automatically added when I added google maps API support to my application.
Any help is appreciated, thanks in advance!
Bump up the firebase dependency version to
compile 'com.google.firebase:firebase-messaging:11.0.2'
or lower the maps dependency to
compile 'com.google.android.gms:play-services-maps:10.2.6'
I get an error saying
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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
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
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
You need to put the apply plugin: 'com.google.gms.google-services' line below your dependencies block - this allows the plugin to determine what version of Play services you are using.
If you have firebase dependencies. Update their version to match version of google services:
Example:
//Firebase Crashreports
compile 'com.google.firebase:firebase-crash:9.6.1'
//Firebase Analytics
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
All must have same 9.6.1 version
just write this after dependencies
apply plugin: 'com.google.gms.google-services'
Do you have the line
apply plugin: 'com.google.gms.google-services'
line in the end of you build.gradle file?
This error came mostly when "apply plugin" put at the top.
I run into the same problem.
My solution was not to add anything to the code but download
Google Support Repository - you can find it in Tools
-> Android -> SDK Manager -> SDK Tools
Just apply the google-services below the dependencies.
worked for me.
I was facing similar problem.At the top when the plugin is added it did not work for me.so Add the plugin at the bottom of the gradle.
this solve my problem of conflict Version
apply plugin: 'com.google.gms.google-services'
and add it dependency these lines
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
I installed Google Repository:
Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
Just go to /platforms/android/cordova-plugin-fcm/*-FCMPlugin.gradle
find for
classpath 'com.google.gms:google-services:+'
replace it with
classpath 'com.google.gms:google-services:3.0.0'
build again.
This is problem is actually take my lot of time, however I solved it by applying the plugin com.google.gms.google-services.
Important: Make sure to don't use it at the top of the gradle file, and use it after the block of dependencies.
I get an error saying
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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
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
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
You need to put the apply plugin: 'com.google.gms.google-services' line below your dependencies block - this allows the plugin to determine what version of Play services you are using.
If you have firebase dependencies. Update their version to match version of google services:
Example:
//Firebase Crashreports
compile 'com.google.firebase:firebase-crash:9.6.1'
//Firebase Analytics
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
All must have same 9.6.1 version
just write this after dependencies
apply plugin: 'com.google.gms.google-services'
Do you have the line
apply plugin: 'com.google.gms.google-services'
line in the end of you build.gradle file?
This error came mostly when "apply plugin" put at the top.
I run into the same problem.
My solution was not to add anything to the code but download
Google Support Repository - you can find it in Tools
-> Android -> SDK Manager -> SDK Tools
Just apply the google-services below the dependencies.
worked for me.
I was facing similar problem.At the top when the plugin is added it did not work for me.so Add the plugin at the bottom of the gradle.
this solve my problem of conflict Version
apply plugin: 'com.google.gms.google-services'
and add it dependency these lines
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
I installed Google Repository:
Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
Just go to /platforms/android/cordova-plugin-fcm/*-FCMPlugin.gradle
find for
classpath 'com.google.gms:google-services:+'
replace it with
classpath 'com.google.gms:google-services:3.0.0'
build again.
This is problem is actually take my lot of time, however I solved it by applying the plugin com.google.gms.google-services.
Important: Make sure to don't use it at the top of the gradle file, and use it after the block of dependencies.
I get an error saying
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 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
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
}
And this is how my app gradle looks like
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:1.1.3#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
You need to put the apply plugin: 'com.google.gms.google-services' line below your dependencies block - this allows the plugin to determine what version of Play services you are using.
If you have firebase dependencies. Update their version to match version of google services:
Example:
//Firebase Crashreports
compile 'com.google.firebase:firebase-crash:9.6.1'
//Firebase Analytics
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.android.gms:play-services-analytics:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
All must have same 9.6.1 version
just write this after dependencies
apply plugin: 'com.google.gms.google-services'
Do you have the line
apply plugin: 'com.google.gms.google-services'
line in the end of you build.gradle file?
This error came mostly when "apply plugin" put at the top.
I run into the same problem.
My solution was not to add anything to the code but download
Google Support Repository - you can find it in Tools
-> Android -> SDK Manager -> SDK Tools
Just apply the google-services below the dependencies.
worked for me.
I was facing similar problem.At the top when the plugin is added it did not work for me.so Add the plugin at the bottom of the gradle.
this solve my problem of conflict Version
apply plugin: 'com.google.gms.google-services'
and add it dependency these lines
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'
I installed Google Repository:
Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK.
Just go to /platforms/android/cordova-plugin-fcm/*-FCMPlugin.gradle
find for
classpath 'com.google.gms:google-services:+'
replace it with
classpath 'com.google.gms:google-services:3.0.0'
build again.
This is problem is actually take my lot of time, however I solved it by applying the plugin com.google.gms.google-services.
Important: Make sure to don't use it at the top of the gradle file, and use it after the block of dependencies.
I am working on the Sample in the below blog
https://www.firebase.com/blog/2015-10-01-firebase-android-app-engine-tutorial.html
The projects fails to compile after adding the dependency
compile 'com.firebase:firebase-client-android:2.3.1'
Other dependencies compile without any issue.
'com.android.support:appcompat-v7:23.0.1'
'compile 'com.android.support:design:23.0.1'
Where am I going wrong ?
here is my module build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.tri.todoapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.firebase:firebase-client-android:2.4.0'
}
Top-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:1.3.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
}
The project fails to compile because version 2.3 doesn't exists. You should use 2.3.1:
compile 'com.firebase:firebase-client-android:2.3.1'
or the newest 2.4.0:
compile 'com.firebase:firebase-client-android:2.4.0'
You can find more information here:
https://www.firebase.com/docs/android/quickstart.html
We are talking about Google api versions without mentioning Google Repository version.
The actual problem here is that your Google Repository doesn't "know" about the firebase version you all were trying to use.
I got same error while following the official firebase documentation
My app-level build.gradle file looked like this:
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
}
apply plugin: 'com.google.gms.google-services'
My Google Repository version was 44
You can check yours in
SDK Manager>Android SDK> SDK Tools (tab)
Latest version is 46 (at the time of writing this)
I updated to latest Google Repository version and the problem was solved!
You can update by checking "Google Repository" under SDK Tools tab and click "Apply" to update Google Repository to latest version
If you do not wish to update your Google Repository version, you can still resolve the issue by lowering your firebase api version slighlty.
For my case, changing app-level build.gradle file to the following also fixes my problem:
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
}
apply plugin: 'com.google.gms.google-services'
firebase version has been lowered to version 10.2.0 from 10.2.1
This works because 10.2.0 is known to Google repository ver 44.
I hope this answer will help many in future.
There are two modules you need to add firebase to:
The android module: You should use the "Add Firebase" checkbox that appears in project structure that will add 2.3.1 to the android app.
The backend module requires 2.4 to run in app engine and those steps require you to add the dependency manually.
In that case, be sure you are adding the jvm client -- not the "android" client for app engine.
compile 'com.firebase:firebase-client-android:2.4.0'
It happens because this version
compile 'com.firebase:firebase-client-android:2.3'
doesn't exist.
You can use one of these:
compile 'com.firebase:firebase-client-android:2.4.0'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.firebase:firebase-client-android:2.3.0'
Pay attention.
compile 'com.firebase:firebase-client-android:2.3.0'
is different from
compile 'com.firebase:firebase-client-android:2.3'
You can find the full list in maven:
using
compile 'com.firebase:firebase-client-android:+'
worked for me.
I had the exact same problem today, but with version 2.4.1. I could however not open the link l jcenter.bintray.com/com/firebase/firebase-client-android/2.4.1/ as mentioned by Mattia Maestrini.
Solution for me: Deactivate my VPN, and then it worked.
it looks like it was a dex limit error. Adding the Firebase SDK must have put me over the limit, to fix this i had to add multiDexEnabled true in the defaultConfig section of my app:build.gradle file as well as compile 'com.android.support:multidex:1.0.0' in the dependencies
Here is my gradle
gradle for project
// 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:1.5.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
}
gradle module app
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.tranetech.openspace.firebasedemo"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.firebaseui:firebase-ui:0.3.1'
compile 'com.android.support:multidex:1.0.0'
}
I not sure you still working with that project or not, but I also faced the same problem with you, my solution is
In your build.gradle (outside the app folder one), add
buildscript {
repositories {
jcenter()
}
dependencies {
////
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
}
}
and in your module build.gradle, add
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.android.support:design:23.+'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.firebase:firebase-client-android:2.4.0'
}
apply plugin:
'com.google.gms.google-services'// <- this code
And the last, don't forget to download google-services.json put in your app folder, the path should look like \yourapplication\app, you also can refer to this link for download google-services.json file. Download a configuration file
compile is deprecated. You should use:
implementation 'com.firebase:firebase-client-android:2.5.2'