How to resolve duplicated gradle Dependency issues

后端 未结 4 1652
情话喂你
情话喂你 2021-02-04 01:33

I have tried to test my code with robolectric. Problem is that it has duplicated References. e.g.

java.lang.RuntimeException: java.lang.RuntimeException: Duplica         


        
4条回答
  •  难免孤独
    2021-02-04 01:42

    Finally get the test running. I've excluded all libs with duplicated classes:

    testImplementation ("org.robolectric:robolectric:4.3"){
        exclude group: 'org.apache.maven', module: 'maven-artifact'
        exclude group: 'org.apache.maven', module: 'maven-artifact-manager'
        exclude group: 'org.apache.maven', module: 'maven-model'
        exclude group: 'org.apache.maven', module: 'maven-plugin-registry'
        exclude group: 'org.apache.maven', module: 'maven-profile'
        exclude group: 'org.apache.maven', module: 'maven-project'
        exclude group: 'org.apache.maven', module: 'maven-settings'
        exclude group: 'org.apache.maven', module: 'maven-error-diagnostics'
        exclude group: "org.apache.maven.wagon"
    }
    

    Not all possibilities tested but a simple test worked already.

提交回复
热议问题