title: How to fix duplicate libraries - more than one library with package name 'android.support.v7.appcompat'
body: <p>Gradle build error - more than one library with package name android.support.v7.appcompat. This project has Chrome Cast in it, so is using android-support-v7-appcompat and CastCompanionLibary-android-master.  Project structure is the following:</p>
  
  <ul>
  <li>BaseGameUtils</li>
  <li>CastCompanionLibrary-android-master</li>
  <li>VideoBrowserActivity</li>
  <li>android-support-v7-appcompat</li>
  <li>android-support-v7-mediarouter</li>
  <li>google-play-services_lib</li>
  </ul>
  
  <p>Really tough error because the compiler doesn't give much information other than 'more than one library with package name 'android.support.v7.appcompat'. Understand why you don't want to be using different versions of the same library, but why doesn't the compiler reveal what versions are being used, and where they are being called from?</p>
  
  <p>Trying to add leaderboard similar to type-a-number challenge (github example project)</p>
  
  <p>There are a total of (7) build.gradle files. One for the top level and one for each of the packages listed above.  Top level gradle file:</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  buildscript {
  
  repositories {
      mavenCentral()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:1.0.0'
  }
  </code></pre>
  
  <p>BaseGameUtils:</p>
  
  <pre><code>dependencies {
      compile 'com.android.support:appcompat-v7:20.0.+'
      compile 'com.android.support:support-v4:20.0.+'
      compile 'com.google.android.gms:play-services-games:6.5+'
      compile 'com.google.android.gms:play-services-plus:6.5+'
      compile 'com.google.android.gms:play-services-appstate:6.5+'
  }
  </code></pre>
  
  <p>CastCompanionLibrary-android-master</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      compile 'com.android.support:appcompat-v7:20.0.+'
      compile project(':android-support-v7-mediarouter')
      compile 'com.google.android.gms:play-services-cast:6.5+'
      compile project(':BaseGameUtils')
  }
  </code></pre>
  
  <p>VideoBrowserActivity</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      compile project(':CastCompanionLibrary-android-master')
  }
  </code></pre>
  
  <p>android-support-v7-appcompat</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
  }
  </code></pre>
  
  <p>android-support-v7-mediarouter</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      compile project(':android-support-v7-appcompat')
  }
  </code></pre>
  
  <p>google-play-services_lib</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
  }
  </code></pre>
  
  <p>Any help is appreciated on this.</p>