Minio Gradle 依赖性 android javax.annotation.CheckReturnValue
Minio Gradle dependency android javax.annotation.CheckReturnValue
我在我的 android 项目中使用了以下库。
io.minio:minio:5.0.2
但是在简单编译/gradle 同步和构建 apk 时出现以下错误。
AGPBI: {"kind":"error","text":"Program type already present: javax.annotation.CheckReturnValue","sources":[{}],"tool":"D8"}
在分析了 MinIO Java sdk 的依赖关系后,我发现 com.google.code.findbugs
导致了这个异常。如下 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
解决方法: 我把它排除在gradle.
implementation ('io.minio:minio:5.0.2'){
exclude group: 'com.google.code.findbugs'
exclude module: 'annotations'
}
这是删除后的 MinIO Java sdk 依赖关系图 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
我在我的 android 项目中使用了以下库。
io.minio:minio:5.0.2
但是在简单编译/gradle 同步和构建 apk 时出现以下错误。
AGPBI: {"kind":"error","text":"Program type already present: javax.annotation.CheckReturnValue","sources":[{}],"tool":"D8"}
在分析了 MinIO Java sdk 的依赖关系后,我发现 com.google.code.findbugs
导致了这个异常。如下 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
解决方法: 我把它排除在gradle.
implementation ('io.minio:minio:5.0.2'){
exclude group: 'com.google.code.findbugs'
exclude module: 'annotations'
}
这是删除后的 MinIO Java sdk 依赖关系图 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