1

I came across this issue

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

I have been reading about it here and here

From what i gather i can find the "offset version" using

./gradlew -q dependencies app:dependencies --configuration compile

The above then results in:

compile - Classpath for compiling the main sources.
+--- project :library
|    \--- com.android.support:support-v4:23.1.1 -> 24.0.0
|         \--- com.android.support:support-annotations:24.0.0
+--- com.google.android.gms:play-services-auth:9.8.0
|    +--- com.google.android.gms:play-services-auth-base:9.8.0
|    |    +--- com.google.android.gms:play-services-base:9.8.0
|    |    |    +--- com.google.android.gms:play-services-basement:9.8.0
|    |    |    |    \--- com.android.support:support-v4:24.0.0 (*)
|    |    |    \--- com.google.android.gms:play-services-tasks:9.8.0
|    |    |         \--- com.google.android.gms:play-services-basement:9.8.0 (*)
|    |    \--- com.google.android.gms:play-services-basement:9.8.0 (*)
|    +--- com.google.android.gms:play-services-base:9.8.0 (*)
|    \--- com.google.android.gms:play-services-basement:9.8.0 (*)
+--- com.facebook.android:facebook-android-sdk:4.13.1
|    +--- com.parse.bolts:bolts-android:1.4.0
|    |    +--- com.parse.bolts:bolts-tasks:1.4.0
|    |    \--- com.parse.bolts:bolts-applinks:1.4.0
|    |         \--- com.parse.bolts:bolts-tasks:1.4.0
|    +--- com.android.support:customtabs:23.4.0
|    |    +--- com.android.support:support-annotations:23.4.0 -> 24.0.0
|    |    \--- com.android.support:support-v4:23.4.0 -> 24.0.0 (*)
|    +--- com.android.support:support-v4:23.4.0 -> 24.0.0 (*)
|    \--- com.android.support:cardview-v7:23.4.0
+--- com.google.code.gson:gson:2.3
+--- com.android.support:appcompat-v7:23.1.1
|    \--- com.android.support:support-v4:23.1.1 -> 24.0.0 (*)
+--- com.google.gms:google-services:3.0.0
+--- com.koushikdutta.ion:ion:2.+ -> 2.1.9
|    +--- com.google.code.gson:gson:2.3
|    \--- com.koushikdutta.async:androidasync:2.1.9
+--- com.ivankocijan:MagicViews:1.0.4
+--- com.nineoldandroids:library:2.4.0
+--- com.android.support:multidex:1.0.0
+--- com.crashlytics.sdk.android:crashlytics:2.6.6
|    +--- io.fabric.sdk.android:fabric:1.3.15
|    +--- com.crashlytics.sdk.android:beta:1.2.3
|    |    \--- io.fabric.sdk.android:fabric:1.3.15
|    +--- com.crashlytics.sdk.android:answers:1.3.11
|    |    \--- io.fabric.sdk.android:fabric:1.3.15
|    \--- com.crashlytics.sdk.android:crashlytics-core:2.3.15
|         +--- io.fabric.sdk.android:fabric:1.3.15
|         \--- com.crashlytics.sdk.android:answers:1.3.11 (*)
+--- com.crashlytics.sdk.android:crashlytics-ndk:1.1.5
|    +--- io.fabric.sdk.android:fabric:1.3.14 -> 1.3.15
|    \--- com.crashlytics.sdk.android:crashlytics-core:2.3.13 -> 2.3.15 (*)
\--- com.google.firebase:firebase-core:9.8.0
     \--- com.google.firebase:firebase-analytics:9.8.0
          +--- com.google.android.gms:play-services-basement:9.8.0 (*)
          +--- com.google.firebase:firebase-common:9.8.0
          |    +--- com.google.android.gms:play-services-basement:9.8.0 (*)
          |    \--- com.google.android.gms:play-services-tasks:9.8.0 (*)
          \--- com.google.firebase:firebase-analytics-impl:9.8.0
               +--- com.google.android.gms:play-services-basement:9.8.0 (*)
               +--- com.google.firebase:firebase-iid:9.8.0
               |    +--- com.google.android.gms:play-services-basement:9.8.0 (*)
               |    \--- com.google.firebase:firebase-common:9.8.0 (*)
               \--- com.google.firebase:firebase-common:9.8.0 (*)

Gradle:

enter image description here

My question is.

Even if i have now found the dependencies with the wrong version, how can i change that ?

I have tried to compile them using the correct version, but the warning remains.

Community
  • 1
  • 1
JPJens
  • 1,185
  • 1
  • 17
  • 39

1 Answers1

2

You should use same compileSdkVersion and buildToolsVersion as Support library e.g.

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:support-v4:24.2.0'
    compile 'com.android.support:palette-v7:24.2.0'
 }

You can see here Support Library, compiledSdkVersion and buildToolsVersion use same version. Just try it and see if it fixes your issues.

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
Ashish Walia
  • 456
  • 6
  • 10
  • Actually by doing that i get the error: Error:The SDK Build Tools revision (24.0.0) is too low for project ':xx'. Minimum required is 25.0.0 – JPJens Mar 18 '17 at 11:05
  • okay so why not change that 25.0.0?? I mean just change Support library version and compiledSdkVersion to 25 as well.. – Ashish Walia Mar 18 '17 at 11:06
  • Yes that seems to remove the error, but which consequences will this have for users or older devices ? – JPJens Mar 18 '17 at 11:15
  • Oh! No, nothing negative.. they are just newer versions of Support library and buildtools which are better for older devices because they have new bugs fixes and improvements. – Ashish Walia Mar 18 '17 at 11:17
  • With the new android gradle plugin 3.x you no longer need to specify a version for the build tools (so, you can now remove the android.buildToolsVersion property). By default, the plugin automatically uses the minimum required build tools version for the version of Android plugin you're using. – Darksymphony May 06 '18 at 16:05