在以下模块中找到重复的类org.hamcrest.BaseDescription,如何解决?

时间:2019-04-29 02:05:45

标签: android-gradle hamcrest

在以下模块中找到了重复的类org.hamcrest.BaseDescription:hamcrest-all-1.3.jar(org.hamcrest:hamcrest-all:1.3),hamcrest-core-1.3.jar(org.hamcrest:hamcrest-core :1.3)和mockito-all-2.0.2-beta.jar(org.mockito:mockito-all:2.0.2-beta)

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'org.mockito:mockito-all:2.0.2-beta'
androidTestImplementation "org.hamcrest:hamcrest-all:1.3"
androidTestImplementation 'androidx.test:core:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

1 个答案:

答案 0 :(得分:0)

我通过更改以下内容解决了重复的类错误:

implementation 'com.googlecode.json-simple:json-simple:1.1.1'

收件人:

implementation('com.googlecode.json-simple:json-simple:1.1.1') {
        exclude group: 'org.hamcrest', module: 'hamcrest-core'
    }

Gradle:app