After updating Findbugs plugin up to 3.0.1 version I can't compile multi module project in Android Studio. Also i use "com.google.code.findbugs:annotations:3.0.1"
dependency for using FindBugs annotations (e.g. @SuppressFBWarnings
).
I get following error while assembling project:
Execution failed for task ':presentation:packageAllDevelopDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: javax/annotation/CheckForNull.class
How can I fix it?
I resolved this issue, the cause was in adding to "com.google.code.findbugs:annotations:3.0.1"
additional dependencies ('com.google.code.findbugs:jsr305:3.0.1'
and 'net.jcip:jcip-annotations:1.0'
). To fix it we need to exclude some transitive dependencies.
Replace:
dependencies {
compile "com.google.code.findbugs:annotations:3.0.1"
}
with
dependencies {
compile ("com.google.code.findbugs:annotations:3.0.1") {
exclude module: 'jsr305'
exclude module: 'jcip-annotations'
}
}
or with
dependencies {
compile ("com.google.code.findbugs:annotations:3.0.1") {
transitive = false
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With