My project is using dagger:1.2.5 the project is running ok until I added a library it's using dagger:2.8 the error happened when I trying to export release version I can't exclude dagger2 out from the library it needed.
This is the library I added.
compile group: 'com.zendesk', name: 'sdk', version: '1.11.0.1'
Copying resources from program jar [/Users/abdulrohim.s/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/retrofit/2.1.0/2de7cd8b95b7021b1d597f049bcb422055119f2c/retrofit-2.1.0.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.gradle/caches/modules-2/files-2.1/com.google.dagger/dagger/2.8/55a1aa1cdcfd06b9950ca856e2bc2790e105146a/dagger-2.8.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/5ed48a1f5dddce4ab3ab11b1fea0137297b95dc4/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/65112fea4883a876cdbe20250eec3c85db456fbe/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/b6775decfcc790b26ade88f0722d05959e182167/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/b003a58680981a62420ce77a71f7e8406b60ebda/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/6e386ff525be258d5cbbefab5153cd5154f853af/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/9c1361777a168d7aef591ac33577c547b5601a18/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/358b5bfbd99e2ac8b7b8434fd7072944eb385249/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/ad4c2409102e79a882581b39b089d2bd92ea4060/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/31a11d5942c661ed3c6d0fc0b5bcde923e00efb0/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.gradle/caches/modules-2/files-2.1/com.parse.bolts/bolts-tasks/1.4.0/d85884acf6810a3bbbecb587f239005cbc846dc4/bolts-tasks-1.4.0.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/2bcdc0ea48c08041f67748be8c98cbdf1e128fc3/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/2.0.1/516c03b21d50a644d538de0f0369c620989cd8f0/jsr305-2.0.1.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.gradle/caches/modules-2/files-2.1/com.squareup.picasso/picasso/2.5.2/7446d06ec8d4f7ffcc53f1da37c95f200dcb9387/picasso-2.5.2.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/acec89ceac55270aed637d5db5e7091678c1af5e/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/d76354d85bb47461c213d3f7acee7ca6a959097d/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.android/build-cache/8343c32f6917ee71388b016bf16deeb6ca333f63/output/jars/classes.jar] (filtered)
Copying resources from program jar [/Users/abdulrohim.s/.gradle/caches/modules-2/files-2.1/com.squareup.dagger/dagger/1.2.5/965d3e29792e7c4193a2906ccadd5ec2fbb6d441/dagger-1.2.5.jar] (filtered)
Warning: Exception while processing task java.io.IOException: Can't write [/Users/abdulrohim.s/Documents/kaidee/AndroidKaidee/App/build/intermediates/transforms/proguard/prod/release/jars/3/1f/main.jar] (Can't read [/Users/abdulrohim.s/.gradle/caches/modules-2/files-2.1/com.squareup.dagger/dagger/1.2.5/965d3e29792e7c4193a2906ccadd5ec2fbb6d441/dagger-1.2.5.jar(;;;;;;**.class)] (Duplicate zip entry [dagger-1.2.5.jar:dagger/Lazy.class]))
:App:transformClassesAndResourcesWithProguardForProdRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':App:transformClassesAndResourcesWithProguardForProdRelease'.
> Job failed, see logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 27.246 secs
# We only want obfuscation
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes Exceptions
-keepattributes *Annotation*
-keepattributes EnclosingMethod
# Sdk
-keep public interface com.zendesk.** { *; }
-keep public class com.zendesk.** { *; }
-dontwarn java.awt.**
# Appcompat and support
-keep interface android.support.v7.** { *; }
-keep class android.support.v7.** { *; }
-keep interface android.support.v4.** { *; }
-keep class android.support.v4.** { *; }
-dontwarn android.app.Notification
# Gson
-keep interface com.google.gson.** { *; }
-keep class com.google.gson.** { *; }
# Retrofit
-keep class com.google.inject.** { *; }
-keep class org.apache.http.** { *; }
-keep class org.apache.james.mime4j.** { *; }
-keep class javax.inject.** { *; }
-keep class retrofit.** { *; }
-keep interface retrofit.** { *; }
-dontwarn rx.**
-dontwarn com.google.appengine.api.urlfetch.**
-dontwarn okio.**
-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
#Picasso
-dontwarn com.squareup.okhttp.**