Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All com.android.support libraries must use the exact same version specification after adding firebase

My android Studio shows this error.

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 26.1.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:support-media-compat:26.1.0 less... (Ctrl+F1) There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).

    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'
    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:15.0.0'
like image 249
Yesudass Moses Avatar asked Nov 29 '25 11:11

Yesudass Moses


2 Answers

Instead of downgrading or excluding the support library, you can solve the problem by overriding the support library. You can override the support library by adding the dependency which is in the error:

implementation "com.android.support:animated-vector-drawable:27.1.1"

For argumentation about this answer, you can see the following issues in Firebase:

  • Support Library out of date
  • com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzf;
like image 190
ישו אוהב אותך Avatar answered Dec 02 '25 02:12

ישו אוהב אותך


It themes like com.google.firebase:firebase-core:15.0.0 depends on older support library varsion (26.1.0).
There already is 15.0.2 version released, so you could try to:

  • use 15.0.2 version of firebase core. Probably it is based on latest support lib
  • ignore this message, as it is a warning, not an error, and probably your app would work fine with it. (not recommended, but could work)
  • downgrade your used support libs version to 26.1.0 so they are the same version. At least until google releases firebase based on the latest support lib version. (recommended way if #1 didn't work)
like image 26
Vladyslav Matviienko Avatar answered Dec 02 '25 03:12

Vladyslav Matviienko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!