IntelliJ is unable to import hamcrest library

2.3k views Asked by At

I'm having some trouble importing my project from build.gradle file. It's not able to find classes from hamcrest-core-1.3.jar.

gradle clean build

runs successfully on terminal.

My environment is

Intellij 2016.3.1
Gradle 2.14.1

It was able to resolve the reference one time but it went away on restart. When it was able to resolve hamcrest, it later failed to resolve pigunit jar. I got NoSuchMethodError (class was loaded from wrong jar) also once.

Invalidate Cache also didn't work. I tried importing the project from scratch multiple times. Please let me know if any other information is needed.

For some reason org.hamcrest.CoreMatchers loads CoreMatchers from mockito-all-1.10.19.jar instead of hamcrest-core-1.3.jar.I played around with the order of these two jars in the modules libraries.

Please refer to the screenshot below. Snapshots

0

There are 0 answers