I have used following library in my android project.
io.minio:minio:5.0.2
But getting following error while simple compile / gradle sync and build apk.
AGPBI: {"kind":"error","text":"Program type already present: javax.annotation.CheckReturnValue","sources":[{}],"tool":"D8"}
After analysing dependencies of MinIO Java sdk I found com.google.code.findbugs
is causing this exception. as in below dependency graph of the MinIO java sdk.
io.minio:minio:5.0.2
+--- com.google.http-client:google-http-client-xml:1.20.0
| \--- com.google.http-client:google-http-client:1.20.0
| +--- com.google.code.findbugs:jsr305:1.3.9 -> 3.0.2
| \--- org.apache.httpcomponents:httpclient:4.0.1
| +--- org.apache.httpcomponents:httpcore:4.0.1
| +--- commons-logging:commons-logging:1.1.1
| \--- commons-codec:commons-codec:1.3
+--- com.google.guava:guava:25.1-jre
| +--- com.google.code.findbugs:jsr305:3.0.2
| +--- org.checkerframework:checker-qual:2.0.0
| +--- com.google.errorprone:error_prone_annotations:2.1.3
| +--- com.google.j2objc:j2objc-annotations:1.1
| \--- org.codehaus.mojo:animal-sniffer-annotations:1.14
+--- com.squareup.okhttp3:okhttp:3.7.0
| \--- com.squareup.okio:okio:1.12.0
+--- com.squareup.okio:okio:1.12.0
+--- joda-time:joda-time:2.7
+--- com.fasterxml.jackson.core:jackson-annotations:2.9.6
+--- com.fasterxml.jackson.core:jackson-core:2.9.6
+--- com.fasterxml.jackson.core:jackson-databind:2.9.6
| +--- com.fasterxml.jackson.core:jackson-annotations:2.9.0 -> 2.9.6
| \--- com.fasterxml.jackson.core:jackson-core:2.9.6
+--- com.google.code.findbugs:annotations:3.0.1
| +--- net.jcip:jcip-annotations:1.0
| \--- com.google.code.findbugs:jsr305:3.0.1 -> 3.0.2
\--- com.google.code.findbugs:jsr305:3.0.1 -> 3.0.2
Solution : I excluded it from the gradle.
implementation ('io.minio:minio:5.0.2'){
exclude group: 'com.google.code.findbugs'
exclude module: 'annotations'
}
Here is the MinIO Java sdk dependency graph After removing com.google.code.findbugs
.
io.minio:minio:5.0.2
+--- com.google.http-client:google-http-client-xml:1.20.0
| \--- com.google.http-client:google-http-client:1.20.0
| \--- org.apache.httpcomponents:httpclient:4.0.1
| +--- org.apache.httpcomponents:httpcore:4.0.1
| +--- commons-logging:commons-logging:1.1.1
| \--- commons-codec:commons-codec:1.3
+--- com.google.guava:guava:25.1-jre
| +--- org.checkerframework:checker-qual:2.0.0
| +--- com.google.errorprone:error_prone_annotations:2.1.3
| +--- com.google.j2objc:j2objc-annotations:1.1
| \--- org.codehaus.mojo:animal-sniffer-annotations:1.14
+--- com.squareup.okhttp3:okhttp:3.7.0
| \--- com.squareup.okio:okio:1.12.0
+--- com.squareup.okio:okio:1.12.0
+--- joda-time:joda-time:2.7
+--- com.fasterxml.jackson.core:jackson-annotations:2.9.6
+--- com.fasterxml.jackson.core:jackson-core:2.9.6
\--- com.fasterxml.jackson.core:jackson-databind:2.9.6
+--- com.fasterxml.jackson.core:jackson-annotations:2.9.0 -> 2.9.6
\--- com.fasterxml.jackson.core:jackson-core:2.9.6