title: How to fix java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class Android
body: <p>I am getting this problem after replacing a <strong>.aar</strong> library with updated .aar.</p>
  
  <p><strong>Logcat</strong></p>
  
  <blockquote>
    <p>Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
    com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class</p>
  </blockquote>
  
  <p>this is my gradle code.</p>
  
  <pre><code>buildscript {
      repositories {
          maven { url 'https://maven.fabric.io/public' }
      }
  
      dependencies {
          classpath 'io.fabric.tools:gradle:1.+'
      }
  }
  apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  
  repositories {
      maven { url 'https://maven.fabric.io/public' }
  }
  
  android {
      compileSdkVersion 23
      buildToolsVersion '23.0.1'
  
      defaultConfig {
          applicationId "--Package-- Name--"
          minSdkVersion 16
          targetSdkVersion 22
          versionCode 1
          versionName "0.0.5"
  
          multiDexEnabled true
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      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'
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile('com.twitter.sdk.android:twitter:1.12.1@aar') {
          transitive = true;
      }
      compile project(':cometchat-sdk')
      compile 'com.android.support:appcompat-v7:23.4.0'
      compile 'com.android.support:design:23.4.0'
      compile 'com.android.support:support-v4:23.4.0'
      compile 'com.android.support:multidex:1.0.0'
      compile 'com.android.support:recyclerview-v7:23.4.0'
      compile 'com.github.bumptech.glide:glide:3.7.0'
      compile 'com.mikhaellopez:circularimageview:3.0.1'
      compile 'com.android.support:cardview-v7:23.4.0'
      compile 'com.facebook.android:facebook-android-sdk:4.8.0'
      compile 'com.google.android.gms:play-services-plus:9.0.1'
      compile 'com.yqritc:recyclerview-flexibledivider:1.2.9'
      compile 'com.loopj.android:android-async-http:1.4.9'
      compile 'com.google.android.gms:play-services-location:9.0.1'
      compile 'com.google.android.gms:play-services-gcm:9.0.1'
      compile 'com.github.eneim:Toro:1.2.0'
      compile 'com.pnikosis:materialish-progress:1.5'
      compile 'com.mcxiaoke.volley:library:1.0.17'
      compile 'org.jsoup:jsoup:1.8.1'
      compile 'org.apache.httpcomponents:httpcore:4.3.2'
      compile 'org.apache.httpcomponents:httpmime:4.3.3'
      compile 'com.parse.bolts:bolts-tasks:1.4.0'
      compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
      compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
      testCompile 'junit:junit:4.12'
  }
  </code></pre>