title: Commons-Io Duplicate Entry Error Using Robospice and Android Studio
body: <p>I've been working on the following issue for several hours, but haven't come up with a way to solve my problem.  I've tried the following fixes from Stack Overflow (<a href="https://stackoverflow.com/questions/27436641/android-studio-update-to-1-0-corrupts-multidex">Android Studio update to 1.0 corrupts MultiDex</a> and <a href="https://stackoverflow.com/questions/26059838/duplicate-zip-entry-after-gradle-plugin-v0-13-1">Duplicate Zip Entry after Gradle Plugin v0.13.1</a>) but neither one of them worked.</p>
  
  <p>I am getting the following error when trying to build my program:</p>
  
  <pre><code>Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
  &gt; java.util.zip.ZipException: duplicate entry: org/apache/commons/io/CopyUtils.class
  </code></pre>
  
  <p>The error seems to indicate that commons-io is being included twice in the build process</p>
  
  <p>I am using Android Studio and Gradle to include multiple Robospice dependencies.  This is the dependencies section of my Gradle build file:</p>
  
  <pre><code>dependencies {
      compile 'com.android.support:multidex:1.0.1'
      compile 'com.android.support:support-v4:21.0.3'
      compile 'com.google.android.gms:play-services:6.5.87'
  
      compile'com.google.api-client:google-api-client-android:1.19.0'
  
  
      // You must install or update the Google Repository through the SDK manager to use this dependency.
      // The Google Repository (separate from the corresponding library) can be found in the Extras category.
      //compile 'com.google.android.gms:play-services:4.3.23'
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile "com.jakewharton:butterknife:${butterknifeVersion}"
      compile 'com.sun.jersey:jersey-bundle:1.8'
      compile 'com.google.code.gson:gson:2.3'
      compile 'org.codehaus.jackson:jackson-core-asl:1.9.0'
      compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.0'
  
      compile ('com.octo.android.robospice:robospice:1.4.14'){
          exclude module: 'commons-io'
          exclude group: 'commons-io'
      }
  
      compile ('com.octo.android.robospice:robospice-spring-android:1.4.14'){
          exclude group: 'org.apache.commons', module: 'commons-io'
      }
  
      compile 'com.squareup.okhttp:okhttp:2.1.0'
  
      compile ('com.octo.android.robospice:robospice-google-http-client:1.4.14'){
          exclude module: 'xpp3'
          exclude group: 'stax'
      }
  
      compile 'org.scribe:scribe:1.3.5'
      compile files("$buildDir/native-libs/native-libs.jar")
  
  }
  </code></pre>
  
  <p>Using the "gradlew -q dependencies app:dependencies" command  to view the project's dependency tree indicates that com.octo.android.robospice:robospice:1.4.14 is dependent on the commons-io library.  Here is the relevant snippet of the project dependency tree:</p>
  
  <pre><code>+--- com.octo.android.robospice:robospice:1.4.14
  |    \--- com.octo.android.robospice:robospice-cache:1.4.14
  |         +--- org.apache.commons:commons-lang3:3.3.2
  |         \--- org.apache.commons:commons-io:1.3.2
  |              \--- commons-io:commons-io:1.3.2
  </code></pre>
  
  <p>The dependency is still listed even though I excluded commons-io from all Robospice related dependencies in the gradle build file.  I also tried changing the group name from commons-io to org.apache.commons, and that did not work either.</p>
  
  <p>My project is at a standstill until I get this resolved, and I would appreciate any help I can get.</p>