0

私は libgdx でゲームを開発しており、外部 jar を使用して JSON を操作しています。libgdx には独自のものがあることは知っていますが、以前にこの jar を使用したことがあり、使用方法を知っています。とにかく、ルートディレクトリのbuild.gradleに追加して同期しました。しかし、プロジェクトをビルドしようとすると、次の大きなエラー メッセージが表示されます。

Duplicate class org.hamcrest.BaseDescription found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.BaseMatcher found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.CoreMatchers found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.Description found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.Factory found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.Matcher found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.SelfDescribing found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.StringDescription found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.AllOf found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.AnyOf found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.DescribedAs found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.Is found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsAnything found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsEqual found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsInstanceOf found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsNot found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsNull found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.core.IsSame found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.internal.ArrayIterator found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.internal.SelfDescribingValue found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)
Duplicate class org.hamcrest.internal.SelfDescribingValueIterator found in modules hamcrest-core-1.1.jar (org.hamcrest:hamcrest-core:1.1) and junit-4.10.jar (junit:junit:4.10)

これが何を意味するのか、またはこの org.hamcrest が重複しているものは何なのか、私にはわかりません。これが私のbuild.gradleファイルです:

buildscript {
    

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://plugins.gradle.org/m2/" }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
        google()
    }
    dependencies {
        classpath 'org.wisepersist:gwt-gradle-plugin:1.0.9'
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.8'
        

    }
}

allprojects {
    apply plugin: "eclipse"

    version = '1.0'
    ext {
        appName = "ShootOut"
        gdxVersion = '1.9.10'
        roboVMVersion = '2.3.8'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.0'
        aiVersion = '1.8.0'
    }

    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
        google()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }
}

project(":desktop") {
    apply plugin: "java-library"


    dependencies {
        implementation project(":core")
        api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
        api "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-desktop"
        api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
        api "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop"
        
    }
}

project(":android") {
    apply plugin: "android"

    configurations { natives }

    dependencies {
        implementation project(":core")
        api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
        api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
        api "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86_64"
        api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
        api "com.badlogicgames.ashley:ashley:$ashleyVersion"
        api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
        api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
        api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
        
    }
}

project(":ios") {
    apply plugin: "java-library"
    apply plugin: "robovm"


    dependencies {
        implementation project(":core")
        api "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
        api "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
        api "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
        api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
        api "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-ios"
        api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
        
    }
}

project(":html") {
    apply plugin: "java-library"
    apply plugin: "gwt"
    apply plugin: "war"


    dependencies {
        implementation project(":core")
        api "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
        api "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
        api "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
        api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
        api "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
        api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion:sources"
        api "com.badlogicgames.ashley:ashley:$ashleyVersion:sources"
        api "com.badlogicgames.gdx:gdx-ai:$aiVersion:sources"
        api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion:sources"
        api "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion:sources"
        
    }
}

project(":core") {
    apply plugin: "java-library"


    dependencies {
        implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
        api "com.badlogicgames.gdx:gdx:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"
        api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
        api "com.badlogicgames.ashley:ashley:$ashleyVersion"
        api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
        api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
        api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
        
    }
}

私が追加したのは、コア プロジェクトの依存関係に「実装グループ: 'com.googlecode.json-simple'、名前: 'json-simple'、バージョン: '1.1.1'」だけでした。このエラーを修正する方法はありますか? または、それを引き起こしているのは何ですか?

4

2 に答える 2