Search code examples
androidfacebook-sdk-4.0retrofit2fresco

Gradle failed with Facebook SDK, Fresco lib and Retrofit?


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'
}

Solution

  • 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';
    }