ぽんこつ備忘録

自分用のWatsonやらAndroidやらやったことの備忘録 さぼりがち

GradleのDuplicate class ... のエラー

WatsonのNLUを新しいバージョンのものを使いたくて
Gradleに下記の依存関係を宣言した(って言い方でいいの?プラグイン??)

implementation 'com.ibm.watson:ibm-watson:7.1.1'

Syncは無事に完了し、ビルドしたら下記のエラーが出た

Duplicate class javax.annotation.CheckForNull found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.CheckForSigned found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.CheckReturnValue found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Detainted found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.MatchesPattern found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.MatchesPattern$Checker found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Nonnegative found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Nonnegative$Checker found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Nonnull found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Nonnull$Checker found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Nullable found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.OverridingMethodsMustInvokeSuper found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.ParametersAreNonnullByDefault found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.ParametersAreNullableByDefault found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.PropertyKey found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.RegEx found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.RegEx$Checker found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Signed found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Syntax found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Tainted found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.Untainted found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.WillClose found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.WillCloseWhenClosed found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.WillNotClose found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.concurrent.GuardedBy found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.concurrent.Immutable found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.concurrent.NotThreadSafe found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.concurrent.ThreadSafe found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.meta.Exclusive found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.meta.Exhaustive found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.meta.TypeQualifier found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.meta.TypeQualifierDefault found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.meta.TypeQualifierNickname found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.meta.TypeQualifierValidator found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class javax.annotation.meta.When found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2)
Duplicate class net.jcip.annotations.GuardedBy found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jcip-annotations-1.0.jar (net.jcip:jcip-annotations:1.0)
Duplicate class net.jcip.annotations.Immutable found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jcip-annotations-1.0.jar (net.jcip:jcip-annotations:1.0)
Duplicate class net.jcip.annotations.NotThreadSafe found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jcip-annotations-1.0.jar (net.jcip:jcip-annotations:1.0)
Duplicate class net.jcip.annotations.ThreadSafe found in modules annotations-3.0.1.jar (com.google.code.findbugs:annotations:3.0.1) and jcip-annotations-1.0.jar (net.jcip:jcip-annotations:1.0)

Go to the documentation to learn how to Fix dependency resolution errors.

いや長い。意味わかんない。
Duplicate class ・・・?クラスの複製?あ、重複ってこと??
Jarファイルが重複してんのかーとかつらつら調べても原因は分からず対処方法もわからず

そもそもGradle周りの理解がゼロなのでこれが果たして何のエラーなのか皆目見当つかずにひたすらにググってると全く同じ症状のGithubのIssueを見つけた

github.com

sidvenuさん、ありがとう…!!
ってことで下記のように書き直したらなおりました

 implementation ('com.ibm.watson:ibm-watson:7.1.1'){
        exclude group: 'com.google.code.findbugs', module: 'annotations'
    }

備忘録の意味も込めてメモしておきます。

ってか就活記事の続きを書いていませんでしたね
さぼり癖、抜けず。