Skip to content Skip to sidebar Skip to footer

Program Type Already Present: Org.hamcrest.corematchers

When i build my app, I got follow error. Program type already present: org.hamcrest.CoreMatchers Message{kind=ERROR, text=Program type already present: org.hamcrest.CoreMatchers,

Solution 1:

Download jar file of json-simple 1.1.1 and put it in libs folder.

And remove implementation 'com.googlecode.json-simple:json-simple:1.1.1' from build.gradle.

I don't know why this solves the problem because I don't know why this problem occurs at all.

Solution 2:

In my case, I encountered a similar error saying like that.

I figured out by syncing my app gradle. It turned out that I modified app gradle code and didn't sync but built the project.

Solution 3:

I have found that excluding the dependent JUnit from json-simple solves this issue as well:

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

The latest version of simple-json depends on JUnit 4.1, which depends on hamcrest-core:1.1 which in my case conflicted with the existing hamcrest-core:1.3.

Post a Comment for "Program Type Already Present: Org.hamcrest.corematchers"