Reputation: 47
I want to add Firebase-database to the my Android application and I have got error.
FAILURE: Build failed with an exception.
What went wrong: 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.8.0.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
build.gradle app
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.lukasz.ogloszenia"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-database:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'
implementation 'com.google.android.gms:play-services-maps:12.0.1'
compile 'com.google.gms:google-services:4.0.1'
}
apply plugin: 'com.google.gms.google-services'
Can someone help me?
Upvotes: 1
Views: 12989
Reputation: 80904
change this:
implementation 'com.google.firebase:firebase-database:11.8.0'
to this:
implementation 'com.google.firebase:firebase-database:12.0.1'
All google play services and firebase dependencies need to have the same version number.
This changes starting from version number 15:
Each Maven dependency matching com.google.android.gms:play-services-* and com.google.firebase:firebase-* is no longer required to have the same version number in order to work correctly at build time and at run time.
https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html
Upvotes: 3