title: Android Studio - Cannot compile project with android-maps-utils
body: <p>The rest of my team is using Eclipse and recently the maps were added back into our project. The error I'm getting is that there is a duplicate of the android.gms library, I'm guessing because the google play services and the map-utils-library both feature this package.</p>
  
  <p>Error:Execution failed for task ':projectname:processDebugResources'.</p>
  
  <blockquote>
    <p>Error: more than one library with package name 'com.google.android.gms'
    You can temporarily disable this error with android.enforceUniquePackageName=false
    However, this is temporary and will be enforced in 1.0</p>
  </blockquote>
  
  <p>Here is my current build.gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      compile project(':third_party:sdk:extras:google:google_play_services')
      compile project(':third_party:facebook-android-sdk-3.17.1:facebook')
      compile project(':third_party:android-maps-utils:map-utils-library') }
  
  android {
      compileSdkVersion 19
      buildToolsVersion "20.0.0"
  
      packagingOptions {
          exclude 'META-INF/DEPENDENCIES.txt'
          exclude 'META-INF/LICENSE.txt'
          exclude 'META-INF/NOTICE.txt'
          exclude 'META-INF/NOTICE'
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/DEPENDENCIES'
          exclude 'META-INF/notice.txt'
          exclude 'META-INF/license.txt'
          exclude 'META-INF/dependencies.txt'
          exclude 'META-INF/LGPL2.1'
      }
  
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              resources.srcDirs = ['src']
              aidl.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
  
          // Move the tests to tests/java, tests/res, etc...
          instrumentTest.setRoot('projectname')
  
          // Move the build types to build-types/&lt;type&gt;
          // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
          // This moves them out of them default location under src/&lt;type&gt;/... which would
          // conflict with src/ being used by the main source set.
          // Adding new build types or product flavors should be accompanied
          // by a similar customization.
          debug.setRoot('build-types/debug')
          release.setRoot('build-types/release')
      } }
  </code></pre>
  
  <p>I have tried removing the separate google play services all together (to try and only use whatever comes with the android-maps-utils), but I get other compiler errors such as not being able to locate this from the manifest:</p>
  
  <pre><code> &lt;meta-data
              android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" /&gt;
  </code></pre>
  
  <p>So what should I do in this situation?</p>
  
  <p>EDIT:</p>
  
  <p>Okay so I've come to the realisation that the answer lies in the build.gradle of the map-utils-library. It featured the following line to bring in the play services:</p>
  
  <pre><code>dependencies {
      compile 'com.google.android.gms:play-services:3+'
  }
  </code></pre>
  
  <p>So I figure I should replace that line with my local copy of the play services:</p>
  
  <pre><code>dependencies {
      compile project(':third_party:sdk:extras:google:google_play_services')
  }
  </code></pre>
  
  <p>The only problem now <em>I think</em> is that the support library is not integrated properly, I for the moment I've added it like so:</p>
  
  <pre><code>dependencies {
      compile 'com.android.support:support-v4:20.0.0'
      compile project(':third_party:sdk:extras:google:google_play_services')
  }
  </code></pre>
  
  <p>Although not an ideal solution, I will attempt to fix up the properties correctly soon!</p>