Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

!!! JUnit version 3.8 or later expected [duplicate]

Tags:

My Android studio project has an app module which is android framework dependent, I have created a new module called domain and it contains only pure java classes and a few test classes.

In this module's build.gradle file, I have added junit and mockito libraries for testing purpose as follows:

apply plugin: 'java' sourceCompatibility = 1.7 targetCompatibility = 1.7 dependencies {     testCompile 'junit:junit:4.11'     testCompile 'org.mockito:mockito-core:1.9.5'     compile project(':common')     compile project(':model')     //test dependencies } 

But Android Studio is giving me !!! JUnit version 3.8 or later expected error message whenever I try to execute the test class.

All the suggested solutions to this problem is to open the Project Structure | Modules | Dependencies, and move the junit-4.7.jar up, so that it comes before Android 1.6 Platform in the classpath.

In fact, I have tried to implement this solution but the problem still exists. Image of my dependencies structure

Any idea on how to resolve this issue?

like image 733
Fshamri Avatar asked Mar 20 '15 17:03

Fshamri


1 Answers

I've already solved this just now. It may help you... maybe. A little instruction:

  1. Go to Run -> Edit Configurations
  2. Delete JUnit configuration on left panel

enter image description here

like image 130
voronnenok Avatar answered Sep 22 '22 09:09

voronnenok