4

Did anyone tried to implement Facebook SDK and Fresco lib and Retrofit? My gradle fails with duplicate about bolts.

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

This is my gradle fail. I tried with Fresco for OkHttp, but still I get the problem above.

dependencies {
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.facebook.fresco:fresco:0.9.0'
    compile 'com.facebook.fresco:imagepipeline-okhttp:0.9.0'
    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
    compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
    compile 'com.android.support:multidex:1.0.1'
}
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Zookey
  • 2,637
  • 13
  • 46
  • 80
  • See if anything here helps you http://stackoverflow.com/questions/28791817/android-studio-gradle-error-multiple-dex-files-define – OneCricketeer Feb 10 '16 at 23:02
  • I have tried that link, but no luck. Any other idea? – Zookey Feb 10 '16 at 23:21
  • I saw in the comments there was an `exclude` in the gradle on the bolts project. I've seen a couple posts now about that library conflicting with *something*, not sure what... – OneCricketeer Feb 10 '16 at 23:23
  • try this https://stackoverflow.com/questions/33209631/errorexecution-failed-for-task-apptransformclasseswithjarmergingfordebug – mahmoud moustafa Feb 10 '16 at 23:37

1 Answers1

8

This is what helped me:

compile ('com.facebook.fresco:fresco:0.9.0+'){
    exclude group: 'com.parse.bolts', module: 'bolts-applinks';
    exclude module: 'bolts-android';
    exclude group: 'com.parse.bolts', module: 'bolts-tasks';
}
Zookey
  • 2,637
  • 13
  • 46
  • 80