How to fix This “All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes)”

I am creating an app that uses firebase authentication for login and registration but I keep getting sudden crashes as soon as I run the application. I'm getting a warning in my Gradle.build file at the app level. The warning says

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:26.1.0

I've tried changing com.android.support:appcompat-v7:28.0.0 to v7:26.0.1 and 27.1.0 but none of them solved the problem.

My build.gradle file is as follows:

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId “com.project.tck.rescueme_responder”
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName “1.0”
testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner”
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile(‘proguard-android-optimize.txt’), ‘proguard-rules.pro
}
}
}

dependencies {
implementation fileTree(dir: ‘libs’, include: [‘*.jar’])
implementation ‘com.android.support:appcompat-v7:28.0.0’
implementation ‘com.android.support.constraint:constraint-layout:1.1.3’
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.firebase:firebase-core:16.0.6’
implementation ‘com.google.firebase:firebase-auth:16.1.0’
implementation ‘com.google.android.gms:play-services-auth:16.0.1’
}
apply plugin: ‘com.google.gms.google-services’

I expect a login that authenticates using FireBase when I run the application but then the application crashes each time I run it.

#java #xml

4 Likes21.55 GEEK