4

I'm trying to run unit test on Android Library project and using mockito 1.9.5 with dexmaker 1.0 & dexmaker -mockito-1.0 jar files.

I am using Android Studio 0.2.6 and whenever I run a test case I end up getting

java.lang.NoClassDefFoundError: org.mockito.Mockito exception.

I have mentioned the dependencies in build.gradle file as below

compile 'com.google.dexmaker:dexmaker-mockito:1.0'
compile 'com.google.dexmaker:dexmaker:1.0'
compile 'org.mockito:mockito-core:1.9.5'

Has anyone encountered this problem before on Android Studio? If you did please share your solutions/fixes.

Thanks

Prasanna
  • 57
  • 1
  • 4

2 Answers2

3

Cleaning the project from a terminal gradlew clean fixed it for me.

Saimon
  • 733
  • 8
  • 14
0

if that doesn't work delete .gradle folder inside project, and what's inside build folder.

Juan Mendez
  • 2,658
  • 1
  • 27
  • 23