I am integrating Firebase Database and Authentication to my Android Project. I get the following error:
Error:org.gradle.api.GradleException: 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.4.0.
My app build.gradle file is below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.antoinecampbell.firebase.demo"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.google.android.gms:play-services-auth:9.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
I know that I am mixing old and new version of dependencies, but can't figure out how to solve it. I will try to make this question as helpful as I can by editing it later.
You need to add a dependency to Google-services to your root build.gradle
. This file is different from your app/build.gradle
one. Follow the Official Documentation to see exactly how your build.gradle
and app/build.gradle
file should look like.
Also Firebase and Play-services need to be on the same version number. So change the dependencies to have at least the same version number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With