Yogesh Ojha
Yogesh Ojha

Reputation: 91

All android support libraries must use the same version specification

I dont know where I went wrong, but this keeps me saying

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

my build.gradle is

        apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.example.project"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.+'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile 'com.android.support:recyclerview-v7:23.2.0'
    compile 'com.android.support:cardview-v7:23.2.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mani:ThinDownloadManager:1.2.2'
    compile 'net.rdrei.android.dirchooser:library:3.2@aar'
    compile 'com.google.android.gms:play-services:10.2.0'
    compile 'com.onesignal:OneSignal:3.+@aar'

}
apply plugin: 'com.google.gms.google-services'

It shows error in this line too

compile 'com.android.support:appcompat-v7:23.2.0'

I tried changing compileSdkVersion to 24 too, but nothing seems to work as of now. Actually everything was working fine before I introduced the play services library.

Upvotes: 2

Views: 709

Answers (1)

Cymk
Cymk

Reputation: 116

This dependency is using version 24.0.0 of com.android.support:animated-vector-drawable:

compile 'com.google.android.gms:play-services:10.2.0'

which will cause android studio to complain that it could lead to bugs/crashes because versions of all your google libraries don't match.

So you have 2 options: (that I know of off the top of my head)

  1. Change your compileSdkVersion to 24 and change all your support library dependencies to version 24 as well to match the play-services dependencies:

    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.android.support:recyclerview-v7:24.0.0'
    compile 'com.android.support:cardview-v7:24.0.0'
    
  2. Downgrade com.google.android.gms:play-services to 9.4 or 9.2.1 so that it doesn't use version 24 of anything. This still requires a minor change to your support libraries from 23.2.0 to simply 23.0.0

    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:23.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile 'com.google.android.gms:play-services:9.4.0'
    

Upvotes: 2

Related Questions