1

Not able to install app in android version 4.4 I am getting error like:

 Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
    > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/api/client/http/AbstractHttpContent.class

I have tried this solution but it didn't worked for me.

Here is my app dependencies

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:support-v13:23.3.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    compile 'com.android.support:cardview-v7:23.3.0'
    compile 'com.google.code.gson:gson:2.1'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile 'com.google.android.gms:play-services-auth:8.4.0'
    compile 'com.google.android.gms:play-services-nearby:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'

    compile 'com.google.http-client:google-http-client-gson:1.20.0'

    compile('com.twitter.sdk.android:twitter:1.13.0@aar') {
        transitive = true
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
    compile project(':library')
    compile project(':facebook-android-sdk-4.8.1')
}

dependencies for library module

dependencies {
  compile 'com.android.support:support-annotations:22.2.0'
}
Community
  • 1
  • 1
Harry Mad
  • 488
  • 5
  • 17
  • Are you using com.google.http-client:google-http-client-gson:1.20.0 and com.google.code.gson:gson both? – Pr38y Apr 15 '16 at 11:32
  • yes, should i not use both ? if not which one ? – Harry Mad Apr 15 '16 at 11:35
  • there are 2 implementation of AbstractHttpContent class in your code. In the dependency somewhere. What is in library module? – Pr38y Apr 15 '16 at 11:42
  • library module is for some custom views. there is no issue is building the app but not able install. – Harry Mad Apr 15 '16 at 11:49
  • 1
    can you please include all your dependencies in the answer. com.google.http-client has been used twice. check your jars in libs and library module both. – Pr38y Apr 15 '16 at 11:52
  • I have updated the question, actually it was working fine before I upgraded android studio to version 2. – Harry Mad Apr 15 '16 at 12:02
  • try cleaning build. If still doesn't work, invalidate cache, restart and run again. – Pr38y Apr 15 '16 at 12:05
  • not working ... there is message while building "Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android." .what it means ? – Harry Mad Apr 15 '16 at 12:48
  • org.apache.httpcomponents:httpclient: are you using this jar? – Pr38y Apr 15 '16 at 13:15
  • http://stackoverflow.com/questions/32068387/dependency-apache-http-client-in-android-with-google-apis – Pr38y Apr 15 '16 at 13:17
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/109257/discussion-between-pr38y-and-harry-mad). – Pr38y Apr 15 '16 at 13:18
  • am also getting same error , don't know how to fix it – Bytecode Jun 18 '16 at 15:33

0 Answers0