title: How to use Gradle's dependency tree to resolve android support library version mismatch?
body: <p><strong>the catalyst</strong></p>
  
  <p>I upgraded Android Studio to 2.3, and Gradle plugin to 3.3</p>
  
  <p><strong>the initial problem</strong></p>
  
  <p>After updating the Gradle plugin to 3.3, I received the error "Error:The SDK Build Tools revision (23.0.3) is too low for project ':mymodulename'. Minimum required is 25.0.0"</p>
  
  <p>I tried adjusting both buildToolsVersion to 25.0.2 and compileSdkVersion to 25, along with all the com.android.support dependencies (since their major version needs to match compileSdkVersion).  That adjustment cleared this problem, but then I realized my app doesn't support Nougat yet so I reduced the compileSdkVersion to my targetSdkVersion of 23.  The error message about build tools being too low was still gone, so I thought I was in the clear.</p>
  
  <p><strong>the first dependency error</strong></p>
  
  <p>After knocking compileSdkVersion down to 23 I tried to rebuild, and saw several errors similar to "Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'". I realized that I had forgotten to change my com.android.support dependencies such that their major version matched the lower compileSdkVersion again, so I bumped them down to 23.3.0</p>
  
  <p><strong>the second dependency error</strong> </p>
  
  <p>After resolving the first dependency error, I was able to compile and run my app again.  However, there was still a red squiggle beneath my first com.android.support dependency, with the error note "all com.android.support libraries must usew the exact same version specification (mixing versions can leads to runtime crashes). Found versions 24.0.0, 23.3.0. Examples include com.android.support:support-v4:24.0.0 and com.android.support:animated-vector-drawable:23.3.0"</p>
  
  <p>Nothing in my build.gradle specifically references 24.0.0, behold:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  
  android {
      compileSdkVersion 23
      buildToolsVersion '25.0.2'
  
  
      defaultConfig {
          applicationId ...
          minSdkVersion 16
          targetSdkVersion 23
          versionCode ...
          versionName ...
      }
      buildTypes {
          debug{
              debuggable true
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      lintOptions{
  
          //check for errors in release builds,
          // but continue the build even when errors are found:
          abortOnError false
      }
      dexOptions{
          jumboMode true
      }
  
  }
  
  repositories {
      // You can also use jcenter if you prefer
      mavenCentral()
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      testCompile 'junit:junit:4.12'
      //android support libs etc.
      compile 'com.android.support:appcompat-v7:23.3.0'
      compile 'com.android.support:support-v13:23.3.0'
      compile 'com.android.support:mediarouter-v7:23.3.0'
      compile 'com.android.support:recyclerview-v7:23.3.0'
      //snackbar support
      compile 'com.android.support:design:23.3.0'
  
      //Facebook Android SDK
      compile 'com.facebook.android:facebook-android-sdk:4.7.0'
      //Facebook Audience Network SDK. Only versions 4.6.0 and above are available
      compile 'com.facebook.android:audience-network-sdk:4.7.0'
  
      //gplay services dependencies
      compile 'com.google.android.gms:play-services-plus:10.0.1'
      compile 'com.google.android.gms:play-services-analytics:10.0.1'
      compile 'com.google.android.gms:play-services-location:10.0.1'
  
      //provides Firebase Analytics
      compile 'com.google.firebase:firebase-core:10.0.1'
  
      //provides Google Mobile Ads SDK, a.k.a the AdMob service.
      compile 'com.google.firebase:firebase-ads:10.0.1'
  
      //dependencies required by the InMobi ads SDK
      compile 'com.squareup.picasso:picasso:2.5.2'
  
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p><strong>the dependency tree</strong></p>
  
  <p>In order to figure out where the 24.0.0 dependency was coming from, I created a dependency tree using './gradlew -q dependencies mymodulename:dependencies --configuration compile'.  The output is:</p>
  
  <pre><code>    compile - Classpath for compiling the main sources.
  +--- com.android.support:appcompat-v7:23.3.0
  |    +--- com.android.support:support-vector-drawable:23.3.0
  |    |    \--- com.android.support:support-v4:23.3.0 -&gt; 24.0.0
  |    |         \--- com.android.support:support-annotations:24.0.0
  |    +--- com.android.support:animated-vector-drawable:23.3.0
  |    |    \--- com.android.support:support-vector-drawable:23.3.0 (*)
  |    \--- com.android.support:support-v4:23.3.0 -&gt; 24.0.0 (*)
  +--- com.android.support:support-v13:23.3.0
  |    \--- com.android.support:support-v4:23.3.0 -&gt; 24.0.0 (*)
  +--- com.android.support:mediarouter-v7:23.3.0
  |    +--- com.android.support:appcompat-v7:23.3.0 (*)
  |    \--- com.android.support:palette-v7:23.3.0
  |         \--- com.android.support:support-v4:23.3.0 -&gt; 24.0.0 (*)
  +--- com.android.support:design:23.3.0
  |    +--- com.android.support:appcompat-v7:23.3.0 (*)
  |    +--- com.android.support:support-v4:23.3.0 -&gt; 24.0.0 (*)
  |    \--- com.android.support:recyclerview-v7:23.3.0
  |         +--- com.android.support:support-v4:23.3.0 -&gt; 24.0.0 (*)
  |         \--- com.android.support:support-annotations:23.3.0 -&gt; 24.0.0
  +--- com.facebook.android:facebook-android-sdk:4.7.0
  |    +--- com.parse.bolts:bolts-android:1.2.0
  |    \--- com.android.support:support-v4:[22,23) -&gt; 24.0.0 (*)
  +--- com.facebook.android:audience-network-sdk:4.7.0
  |    \--- com.google.android.gms:play-services-ads:7.8.0 -&gt; 10.0.1
  |         +--- com.google.android.gms:play-services-ads-lite:10.0.1
  |         |    \--- com.google.android.gms:play-services-basement:10.0.1
  |         |         \--- com.android.support:support-v4:24.0.0 (*)
  |         +--- com.google.android.gms:play-services-base:10.0.1
  |         |    +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |         |    \--- com.google.android.gms:play-services-tasks:10.0.1
  |         |         \--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |         +--- com.google.android.gms:play-services-clearcut:10.0.1
  |         |    +--- com.google.android.gms:play-services-base:10.0.1 (*)
  |         |    \--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |         +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |         \--- com.google.android.gms:play-services-gass:10.0.1
  |              \--- com.google.android.gms:play-services-basement:10.0.1 (*)
  +--- com.google.android.gms:play-services-plus:10.0.1
  |    +--- com.google.android.gms:play-services-base:10.0.1 (*)
  |    \--- com.google.android.gms:play-services-basement:10.0.1 (*)
  +--- com.google.android.gms:play-services-analytics:10.0.1
  |    +--- com.google.android.gms:play-services-analytics-impl:10.0.1
  |    |    +--- com.google.android.gms:play-services-base:10.0.1 (*)
  |    |    \--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |    +--- com.google.android.gms:play-services-base:10.0.1 (*)
  |    +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |    \--- com.google.android.gms:play-services-tagmanager-v4-impl:10.0.1
  |         +--- com.google.android.gms:play-services-analytics-impl:10.0.1 (*)
  |         +--- com.google.android.gms:play-services-base:10.0.1 (*)
  |         \--- com.google.android.gms:play-services-basement:10.0.1 (*)
  +--- com.google.android.gms:play-services-location:10.0.1
  |    +--- com.google.android.gms:play-services-base:10.0.1 (*)
  |    +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |    \--- com.google.android.gms:play-services-tasks:10.0.1 (*)
  +--- com.google.firebase:firebase-core:10.0.1
  |    \--- com.google.firebase:firebase-analytics:10.0.1
  |         +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |         +--- com.google.firebase:firebase-common:10.0.1
  |         |    +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |         |    \--- com.google.android.gms:play-services-tasks:10.0.1 (*)
  |         \--- com.google.firebase:firebase-analytics-impl:10.0.1
  |              +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |              +--- com.google.firebase:firebase-iid:10.0.1
  |              |    +--- com.google.android.gms:play-services-basement:10.0.1 (*)
  |              |    \--- com.google.firebase:firebase-common:10.0.1 (*)
  |              \--- com.google.firebase:firebase-common:10.0.1 (*)
  +--- com.google.firebase:firebase-ads:10.0.1
  |    +--- com.google.android.gms:play-services-ads:10.0.1 (*)
  |    \--- com.google.firebase:firebase-analytics:10.0.1 (*)
  +--- com.squareup.picasso:picasso:2.5.2
  \--- com.android.support:recyclerview-v7:23.3.0 (*)
  
  (*) - dependencies omitted (listed previously)
  </code></pre>
  
  <p><strong>the questions</strong></p>
  
  <ol>
  <li><p>What does the dependency tree syntax 'lib version -> different lib version' mean?  Specifically, when the tree says "com.android.support:support-v4:23.3.0 -> 24.0.0", what does it mean?</p></li>
  <li><p>If there are implicit requirements for com.android.support version 24.x.x libraries in some of my other dependencies (see com.google.android.gms:play-services-basement:10.0.1 depending on com.android.support:support-v4:24.0.0), why didn't this build.gradle throw errors prior to the Android Studio, Gradle plugin, and buildToolsVersion update mentioned earlier?</p></li>
  <li><p>How can I make sure all my dependencies are compatible with compileSdkVersion 23?</p></li>
  </ol>