Search code examples
androidandroid-studiobuild.gradlefirebaseui

All com.android.support libraries must use the exact same version specification (mixing versions can lead to run time crashes)


After I added firebaseUi library to the gradle, it is showing this error -

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

but I couldn't find any use of paletter-v7:23.4.0 library

gradle -

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "cpm.advancetect.atadvertisement"
        minSdkVersion 19
        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.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-storage:10.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.firebaseui:firebase-ui-storage:1.2.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

Solution

  • That happens cos some of your dependencies are using the Palette library. The simpler solution is to make your app also depend on the Palette library, but using the expected version.

    So, just adding compile 'com.android.support:palette-v7:25.3.1' to your app dependencies will do the trick.