Class Not Found: Empty Test Suite in IntelliJ












142














I'm just starting the computer science program at my college, and I'm having some issues with IntelliJ. When I try to run unit tests, I get the message



Process finished with exit code 1
Class not found: "edu.macalester.comp124.hw0.AreaTest"Empty test suite.


I also see a message entitled "No tests were found" on the left side of my screen. My test code is here:



package edu.macalester.comp124.hw0;


import org.junit.Test;
import static org.junit.Assert.*;

public class AreaTest {

@Test
public void testSquare() {
assertEquals(Area.getSquareArea(3.0), 9.0, 0.001);
}

@Test
public void testCircle() {
assertEquals(Area.getCircleArea(3.0), 28.2743, 0.001);
}
}


And my project code is here:



package edu.macalester.comp124.hw0;

import java.lang.Math;
public class Area {

/**
* Calculates the area of a square.
* @param sideLength The length of the side of a square
* @return The area
*/
public static double getSquareArea(double sideLength) {
// Has been replaced by correct formula
return sideLength * sideLength;
}

/**
* Calculates the area of a circle.
* @param radius The radius of the circle
* @return The area
*/
public static double getCircleArea(double radius) {
// Replaced by correct value
return radius * 2 * Math.PI;
}

}


How can I get my tests to work? Thanks in advance. I'm using the most recent version of IntelliJ IDEA CE.










share|improve this question


















  • 5




    So many things can go wrong. For me, it was as simple as typing mvn clean package in the terminal. Unsure why IntelliJ imported the project incorrectly at the beginning.
    – MarkHu
    Mar 31 '17 at 20:23






  • 1




    For me just make the folder as "test resource root"...
    – Xin Meng
    Apr 10 '17 at 11:53










  • Related post - Why is the Android test runner reporting “Empty test suite”? & Class not found: Empty test suite when running unit tests in Android Studio
    – RBT
    Aug 20 '18 at 5:11
















142














I'm just starting the computer science program at my college, and I'm having some issues with IntelliJ. When I try to run unit tests, I get the message



Process finished with exit code 1
Class not found: "edu.macalester.comp124.hw0.AreaTest"Empty test suite.


I also see a message entitled "No tests were found" on the left side of my screen. My test code is here:



package edu.macalester.comp124.hw0;


import org.junit.Test;
import static org.junit.Assert.*;

public class AreaTest {

@Test
public void testSquare() {
assertEquals(Area.getSquareArea(3.0), 9.0, 0.001);
}

@Test
public void testCircle() {
assertEquals(Area.getCircleArea(3.0), 28.2743, 0.001);
}
}


And my project code is here:



package edu.macalester.comp124.hw0;

import java.lang.Math;
public class Area {

/**
* Calculates the area of a square.
* @param sideLength The length of the side of a square
* @return The area
*/
public static double getSquareArea(double sideLength) {
// Has been replaced by correct formula
return sideLength * sideLength;
}

/**
* Calculates the area of a circle.
* @param radius The radius of the circle
* @return The area
*/
public static double getCircleArea(double radius) {
// Replaced by correct value
return radius * 2 * Math.PI;
}

}


How can I get my tests to work? Thanks in advance. I'm using the most recent version of IntelliJ IDEA CE.










share|improve this question


















  • 5




    So many things can go wrong. For me, it was as simple as typing mvn clean package in the terminal. Unsure why IntelliJ imported the project incorrectly at the beginning.
    – MarkHu
    Mar 31 '17 at 20:23






  • 1




    For me just make the folder as "test resource root"...
    – Xin Meng
    Apr 10 '17 at 11:53










  • Related post - Why is the Android test runner reporting “Empty test suite”? & Class not found: Empty test suite when running unit tests in Android Studio
    – RBT
    Aug 20 '18 at 5:11














142












142








142


23





I'm just starting the computer science program at my college, and I'm having some issues with IntelliJ. When I try to run unit tests, I get the message



Process finished with exit code 1
Class not found: "edu.macalester.comp124.hw0.AreaTest"Empty test suite.


I also see a message entitled "No tests were found" on the left side of my screen. My test code is here:



package edu.macalester.comp124.hw0;


import org.junit.Test;
import static org.junit.Assert.*;

public class AreaTest {

@Test
public void testSquare() {
assertEquals(Area.getSquareArea(3.0), 9.0, 0.001);
}

@Test
public void testCircle() {
assertEquals(Area.getCircleArea(3.0), 28.2743, 0.001);
}
}


And my project code is here:



package edu.macalester.comp124.hw0;

import java.lang.Math;
public class Area {

/**
* Calculates the area of a square.
* @param sideLength The length of the side of a square
* @return The area
*/
public static double getSquareArea(double sideLength) {
// Has been replaced by correct formula
return sideLength * sideLength;
}

/**
* Calculates the area of a circle.
* @param radius The radius of the circle
* @return The area
*/
public static double getCircleArea(double radius) {
// Replaced by correct value
return radius * 2 * Math.PI;
}

}


How can I get my tests to work? Thanks in advance. I'm using the most recent version of IntelliJ IDEA CE.










share|improve this question













I'm just starting the computer science program at my college, and I'm having some issues with IntelliJ. When I try to run unit tests, I get the message



Process finished with exit code 1
Class not found: "edu.macalester.comp124.hw0.AreaTest"Empty test suite.


I also see a message entitled "No tests were found" on the left side of my screen. My test code is here:



package edu.macalester.comp124.hw0;


import org.junit.Test;
import static org.junit.Assert.*;

public class AreaTest {

@Test
public void testSquare() {
assertEquals(Area.getSquareArea(3.0), 9.0, 0.001);
}

@Test
public void testCircle() {
assertEquals(Area.getCircleArea(3.0), 28.2743, 0.001);
}
}


And my project code is here:



package edu.macalester.comp124.hw0;

import java.lang.Math;
public class Area {

/**
* Calculates the area of a square.
* @param sideLength The length of the side of a square
* @return The area
*/
public static double getSquareArea(double sideLength) {
// Has been replaced by correct formula
return sideLength * sideLength;
}

/**
* Calculates the area of a circle.
* @param radius The radius of the circle
* @return The area
*/
public static double getCircleArea(double radius) {
// Replaced by correct value
return radius * 2 * Math.PI;
}

}


How can I get my tests to work? Thanks in advance. I'm using the most recent version of IntelliJ IDEA CE.







java unit-testing intellij-idea junit






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 1 '16 at 23:29









arnbobo

1,0352513




1,0352513








  • 5




    So many things can go wrong. For me, it was as simple as typing mvn clean package in the terminal. Unsure why IntelliJ imported the project incorrectly at the beginning.
    – MarkHu
    Mar 31 '17 at 20:23






  • 1




    For me just make the folder as "test resource root"...
    – Xin Meng
    Apr 10 '17 at 11:53










  • Related post - Why is the Android test runner reporting “Empty test suite”? & Class not found: Empty test suite when running unit tests in Android Studio
    – RBT
    Aug 20 '18 at 5:11














  • 5




    So many things can go wrong. For me, it was as simple as typing mvn clean package in the terminal. Unsure why IntelliJ imported the project incorrectly at the beginning.
    – MarkHu
    Mar 31 '17 at 20:23






  • 1




    For me just make the folder as "test resource root"...
    – Xin Meng
    Apr 10 '17 at 11:53










  • Related post - Why is the Android test runner reporting “Empty test suite”? & Class not found: Empty test suite when running unit tests in Android Studio
    – RBT
    Aug 20 '18 at 5:11








5




5




So many things can go wrong. For me, it was as simple as typing mvn clean package in the terminal. Unsure why IntelliJ imported the project incorrectly at the beginning.
– MarkHu
Mar 31 '17 at 20:23




So many things can go wrong. For me, it was as simple as typing mvn clean package in the terminal. Unsure why IntelliJ imported the project incorrectly at the beginning.
– MarkHu
Mar 31 '17 at 20:23




1




1




For me just make the folder as "test resource root"...
– Xin Meng
Apr 10 '17 at 11:53




For me just make the folder as "test resource root"...
– Xin Meng
Apr 10 '17 at 11:53












Related post - Why is the Android test runner reporting “Empty test suite”? & Class not found: Empty test suite when running unit tests in Android Studio
– RBT
Aug 20 '18 at 5:11




Related post - Why is the Android test runner reporting “Empty test suite”? & Class not found: Empty test suite when running unit tests in Android Studio
– RBT
Aug 20 '18 at 5:11












36 Answers
36






active

oldest

votes













1 2
next












95














Had the same message. I had to remove the Run/Debug configuration.



In my case, I ran the unit test as a local test before. After that I moved my test to the androidTest package and tried to run it again. Android Studio remembered the last run configuration so it tried to run it again as a local unit test which produced the same error.



After removing the config and running the test again it generated a new configuration and worked.



enter image description here






share|improve this answer























  • I think in most cases your solution would be the most universal and the least magical. Worked in my project like a charm.
    – ba3a
    Sep 11 '17 at 20:22










  • I tried it but it didn't work on its own. I also had to Invalidate the Cashes. File > Cashes / Restart
    – Lukasz
    Sep 20 '17 at 21:00










  • I tried it and also invalidated the cashes. But still doesn't work.
    – wings
    Dec 27 '17 at 11:11










  • This worked for me after I remembered to click the obvious ok button instead of just closing the dialog box :-)
    – rimsky
    Feb 7 '18 at 0:07












  • I dont see any "Specific instrumentation runner" entry in my Android Studio.
    – david
    Feb 26 '18 at 13:33



















38














I went to



File -> Invalidate Caches/Restart...


and then it worked for me.






share|improve this answer

















  • 3




    I did this, and then also had to delete the test configurations.
    – Johan Henkens
    May 2 '18 at 16:40



















31














I had the same issue. I rebuilded project, and it helped me.



Go to Build --> Rebuild Project



After then, if you are using Maven tool, I recommend use option Reimport All Maven Projects




If it not help, try another possible solutions:




  • Go to File-->Invalidate Caches/Restart--> Invalidate and Restart


or:




  • In your Maven project structure src/main/java right click on java directory and select option Mark directory as --> Sources Root

    Similarly do the same with test directory so: src/test/java right click on java directory and select option Mark directory as --> Test
    Sources Root




or:




  • Go to Run --> Edit Configurations and in section JUnit remove test configurations. Apply changes. After then try to run your tests. New configuration should be created automatically.


or:




  • Go to File --> Project Structure, select Modules, then select your proper module and go to the Paths tab.
    Check options:
    Radio button Use module compile output path should be selected.

    Output path should be inside your project. Also Test output path should be directory inside your project. For example it can look similarly:
    Output path: C:pathtoyourmoduleyourModule targetclasses
    Test Output path: C:pathtoyourmoduleyourModule targettest-classes

    Exclude output paths should be deselected.






share|improve this answer

















  • 5




    Rebuilding the project (Build -> Rebuild Project) was what worked for me. Thank you!
    – Francisco C.
    Mar 21 '18 at 20:07










  • This solution worked for me, the last thing about the modules and using an output path. Thanks.
    – Mohammad Ganji
    Nov 10 '18 at 10:50










  • As a more desperate solution, delete the .idea file and open the project again. You will lose some configuration/settings, however.
    – Aaron
    Nov 22 '18 at 22:27



















14














This might also happen, if your test folder has been imported as a separate module (a small square is shown on the folder icon in the project view).

Remove the module by selecting the test folder in the project view and press DEL.

Then start your test.

If a popup dialog appears with an error message, that no module is selected, specify your root module from the dropdown.






share|improve this answer

















  • 3




    This was my problem also (square on test folder - would not have known what that meant!); to fix, I opened the run configuration and found that "Use class path of module:" was set to the test module. I changed it to the class path of my project instead, and it worked fine. Thanks for pointing out the "separate module" gotcha!
    – Redboots
    Nov 30 '17 at 23:40










  • This is exactly what happened to me. I created a Spring project using start.spring.io and opened it. Afterwards I started the SpringBootTest and ran into the the "Class not found: "..."Empty test suite" error. After following your solution and pressing the DELETE button on test folder and recreating run configuration everything was fine. Additional hint: When pressing delete button on test folder a dialog comes up saying something like "no files will be deleted". So no fear pressing the button.
    – stritzi
    Nov 21 '18 at 17:24



















11














I had a similar problem after starting a new IntelliJ project. I found that the "module compile output path" for my module was not properly specified. When I assigned the path in the module's "compile output path" to the proper location, the problem was solved. The compile output path is assigned in the Project settings. Under Modules, select the module involved and select the Paths tab...



Paths tab in the Project Settings | Modules dialog



screenshot



...I sent the compiler output to a folder named "output" that is present in the parent Project folder.






share|improve this answer































    8














    So, my issue here was with folder names. I had called my code folder Classes 2016/2017, which IntelliJ didn't like. Simply remove the slash (or other offending character in path), re-import the project, and you'll be good to go!






    share|improve this answer





















    • This helped me. For others, I had the folder in Dropbox. When I moved it out of Dropbox and re-imported, the problem went away.
      – Mick Sear
      Feb 8 '17 at 11:31










    • This answer deserves a nobel peace prize!
      – Ali Abbas Jaffri
      Oct 25 '17 at 15:24



















    7














    In Android Studio 3.0 +, sometimes UI tests are somehow interpreted as unit tests and it doesn't ask for target deployment selection. You can go to Edit Configuration and mark it as an Integration test and it would start working






    share|improve this answer





















    • Also, on Android Studio 3.0.1 the run button next to the test doesn't work. After updating to 3.1 canary 8 it did start working again.
      – Marc
      Jan 19 '18 at 10:30



















    5














    I had the same question when I import some jar from Maven, and subsequently, cause the empty-test-suite error.



    In my case, it was because the maven resetting the module files. Which I resolved by clearing my default configuration:




    1. Open Project structure with shift-ctrl-alt-s shortcut


    Screenshot of PModules Sources




    1. Look at the Modules > Sources and fill the Sources package or test Package.






    share|improve this answer































      4














      This will also happen when your module- and/or project-jdk aren't properly configured.






      share|improve this answer





























        4














        Reimport project or module can solve the issue.
        I made this issue by renaming package name when developing. But the out path and test output path is the old path. So intellij can't find the class from the old path.
        So the easiest way is correcting the out path and test output path.



        Intellij module setting






        share|improve this answer























        • For some reason inherit project path doesn't work for me on MacOs, do you have any ideas why it can be happeningn?
          – Johnny_D
          Jun 22 '18 at 18:46










        • @Johnny_D Are you sure your issue is due to rename package?
          – Bejond
          Jun 25 '18 at 8:59





















        3














        I had the same problem and rebuilding/invalidating cache etc. didn't work. Seems like that's just a bug in Android Studio...



        A temporary solution is just to run your unit tests from the command line with:



        ./gradlew test


        See: https://developer.android.com/studio/test/command-line.html






        share|improve this answer





























          3














          I had the same issue (Android Studio 3.2 Canary 4) and I tried most of suggestions described in other answers - without any success. Note this happened after I moved the file from test to androidTest folder. It was still shown in run configurations as test instead of instrumented test.



          I finally end up with creating a new file:





          1. Create new instrumented test class with different name.

          2. Copy all the code from your class.

          3. Run it.

          4. Delete the old class.

          5. Rename new class to desired name.







          share|improve this answer





























            3














            In my case, I had everything else in the right place, but I was working on a java library with kotlin.
            I just forgot to apply the plugin:



            apply plugin: 'kotlin-android'


            And now it's working as expected now.






            share|improve this answer































              2














              Deleting .idea and re-importing the SBT project solved this issue for me.






              share|improve this answer





















              • It works after deleting the .idea folder and re-importing the maven project (y)
                – Amine Soumiaa
                Apr 5 '18 at 12:21



















              2














              Interestingly, I've faced this issue many times due to different reasons. For e.g. Invalidating cache and restarting has helped as well.



              Last I fixed it by correcting my output path in File -> Project Structure -> Project -> Project Compiler Output to : absolute_path_of_package/out



              for e.g. : /Users/random-guy/myWorkspace/src/DummyProject/out






              share|improve this answer





























                1














                I had the same issue. In my case i had some test classes in a package/folder outside of the main folder. But when i checked the Run configuration, it was always trying to look for classes inside the main folder (and not my packages outside of main) .
                So if that is the case , you either have to move your packages to where the Run configuration is pointing to.
                Or change the run configuration to point to your packages.






                share|improve this answer





























                  1














                  Does your test require an Android device (emulator or hardware)?

                  If so, it's called an "instrumented test" and resides in "module-name/src/androidTest/java/".

                  If not, it's called a "local unit test" and resides in "module-name/src/test/java"



                  https://developer.android.com/training/testing/start/index.html



                  I got the same error because I had written a local unit test, but it was placed in the folder for instrumented tests. Moving the local unit test to the "src/test/java" folder fixed it for me.






                  share|improve this answer





























                    1














                    Was getting same error. My device was not connected to android studio. When I connected to studio. It works. This solves my problem.






                    share|improve this answer





























                      1














                      It's probably because the folder is not set as test source, which can be done via Module Settings > Modules.






                      share|improve this answer





























                        1














                        In my case, the problem was fixed by going into my build.gradle and changing



                        dependencies {
                        testImplementation 'junit:junit:4.12'
                        }


                        to



                        dependencies {
                        testCompile 'junit:junit:4.12'
                        }





                        share|improve this answer





















                        • This helped for me too, surprisingly.Looks like it forced a recompile. Tried several cleanups/cache before without help
                          – Dieter Menne
                          Dec 8 '17 at 8:20










                        • For what it is worth, the issue for me was fixed like the solution I propose above. However, the reason was that I was using a plugin that did not support the 'implementation' command. So I would suggest that you may want to see if some of your project's plugins have updates as well. Perhaps a better approach would be to update the plugin since Gradle wants to deprecate the "compile" command
                          – bremen_matt
                          Dec 8 '17 at 8:41



















                        1














                        In my case, IntelliJ didn't compile the test sources for a strange reason. I simply modified the build configuration and added the maven goal clean test-compile in the Before launch section






                        share|improve this answer





















                        • Tried all the above, but only this helped :) Thank you!
                          – Antenka
                          May 16 '18 at 18:11



















                        1














                        I tried all solutions but none of them helped. At the end i run test in debug mode and.... it started to work. Maybe some maven's cache was cleared up. It is difficult to say. It works. Try mvn test -X






                        share|improve this answer





























                          1














                          Just click your mouse right button on the file in Projects windows and select



                          "Run YourTest".



                          Everything just starts OK now, probably because faulty run configuration is being rebuild anew.






                          share|improve this answer





























                            1














                            This can happen (at least once for me ;) after installing the new version of IntelliJ and the IntelliJ plugins have not yet updated.



                            You may have to manually do the Check for updates… from IntelliJ Help menu.






                            share|improve this answer































                              0














                              Same issue here using IDEA 15.0.6, and nothing helped except when I renamed the package the test class was in. Afterwards I renamed it back to its original name and it still worked, so the rename action might have cleared some cache.






                              share|improve this answer





























                                0














                                For me it was because my project was being compiled into a directory outside of the project. In paths the output paths were productionproject_name and testproject_name which was putting them in C:productionproject_name. Changing them to the full path of the project allowed my tests to access the class files.






                                share|improve this answer





























                                  0














                                  I had the same issue in my environment also (MacOS). I was using IntelliJ 2016. I had a Java library project (gradle).



                                  What I did was




                                  1. Opened/exported project from a IntelliJ older version (like IntelliJ14).
                                    This happened successfully and I verified it with by making the project and by running a test case.

                                  2. Then I imported that project again via IntelliJ 2016.
                                    After that it worked fine(building and test case running).






                                  share|improve this answer





























                                    0














                                    What worked for me was right click on the Project folder -> Maven -> Generate Sources and Update Folders






                                    share|improve this answer





























                                      0














                                      For me the project was compiled outside the project. I just change the path.
                                      For changing the path (i'm using mac).




                                      • Go to File --> Project Structure

                                      • Go to Module on left side.

                                      • Select Paths, select radio button(use module compile output path)

                                      • Provide output path and Test output path which is inside your project

                                      • Deselect Exclude output paths.

                                      • Go to File --> Click on Invalidate Cache and restart






                                      share|improve this answer





























                                        0














                                        My fix for this issue was with folder names and paths.



                                        My test were missing /java/ folder for some reason and IntelliJ didn't like that.



                                        so from
                                        ../test/com/..
                                        to
                                        ../test/java/com/..



                                        and it is ok






                                        share|improve this answer

























                                          1 2
                                          next


                                          protected by Michael Roland Jul 24 '18 at 5:50



                                          Thank you for your interest in this question.
                                          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                          Would you like to answer one of these unanswered questions instead?














                                          36 Answers
                                          36






                                          active

                                          oldest

                                          votes








                                          36 Answers
                                          36






                                          active

                                          oldest

                                          votes









                                          active

                                          oldest

                                          votes






                                          active

                                          oldest

                                          votes








                                          1 2
                                          next










                                          95














                                          Had the same message. I had to remove the Run/Debug configuration.



                                          In my case, I ran the unit test as a local test before. After that I moved my test to the androidTest package and tried to run it again. Android Studio remembered the last run configuration so it tried to run it again as a local unit test which produced the same error.



                                          After removing the config and running the test again it generated a new configuration and worked.



                                          enter image description here






                                          share|improve this answer























                                          • I think in most cases your solution would be the most universal and the least magical. Worked in my project like a charm.
                                            – ba3a
                                            Sep 11 '17 at 20:22










                                          • I tried it but it didn't work on its own. I also had to Invalidate the Cashes. File > Cashes / Restart
                                            – Lukasz
                                            Sep 20 '17 at 21:00










                                          • I tried it and also invalidated the cashes. But still doesn't work.
                                            – wings
                                            Dec 27 '17 at 11:11










                                          • This worked for me after I remembered to click the obvious ok button instead of just closing the dialog box :-)
                                            – rimsky
                                            Feb 7 '18 at 0:07












                                          • I dont see any "Specific instrumentation runner" entry in my Android Studio.
                                            – david
                                            Feb 26 '18 at 13:33
















                                          95














                                          Had the same message. I had to remove the Run/Debug configuration.



                                          In my case, I ran the unit test as a local test before. After that I moved my test to the androidTest package and tried to run it again. Android Studio remembered the last run configuration so it tried to run it again as a local unit test which produced the same error.



                                          After removing the config and running the test again it generated a new configuration and worked.



                                          enter image description here






                                          share|improve this answer























                                          • I think in most cases your solution would be the most universal and the least magical. Worked in my project like a charm.
                                            – ba3a
                                            Sep 11 '17 at 20:22










                                          • I tried it but it didn't work on its own. I also had to Invalidate the Cashes. File > Cashes / Restart
                                            – Lukasz
                                            Sep 20 '17 at 21:00










                                          • I tried it and also invalidated the cashes. But still doesn't work.
                                            – wings
                                            Dec 27 '17 at 11:11










                                          • This worked for me after I remembered to click the obvious ok button instead of just closing the dialog box :-)
                                            – rimsky
                                            Feb 7 '18 at 0:07












                                          • I dont see any "Specific instrumentation runner" entry in my Android Studio.
                                            – david
                                            Feb 26 '18 at 13:33














                                          95












                                          95








                                          95






                                          Had the same message. I had to remove the Run/Debug configuration.



                                          In my case, I ran the unit test as a local test before. After that I moved my test to the androidTest package and tried to run it again. Android Studio remembered the last run configuration so it tried to run it again as a local unit test which produced the same error.



                                          After removing the config and running the test again it generated a new configuration and worked.



                                          enter image description here






                                          share|improve this answer














                                          Had the same message. I had to remove the Run/Debug configuration.



                                          In my case, I ran the unit test as a local test before. After that I moved my test to the androidTest package and tried to run it again. Android Studio remembered the last run configuration so it tried to run it again as a local unit test which produced the same error.



                                          After removing the config and running the test again it generated a new configuration and worked.



                                          enter image description here







                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited Dec 14 '16 at 13:41

























                                          answered Dec 14 '16 at 12:29









                                          com2ghz

                                          1,8071820




                                          1,8071820












                                          • I think in most cases your solution would be the most universal and the least magical. Worked in my project like a charm.
                                            – ba3a
                                            Sep 11 '17 at 20:22










                                          • I tried it but it didn't work on its own. I also had to Invalidate the Cashes. File > Cashes / Restart
                                            – Lukasz
                                            Sep 20 '17 at 21:00










                                          • I tried it and also invalidated the cashes. But still doesn't work.
                                            – wings
                                            Dec 27 '17 at 11:11










                                          • This worked for me after I remembered to click the obvious ok button instead of just closing the dialog box :-)
                                            – rimsky
                                            Feb 7 '18 at 0:07












                                          • I dont see any "Specific instrumentation runner" entry in my Android Studio.
                                            – david
                                            Feb 26 '18 at 13:33


















                                          • I think in most cases your solution would be the most universal and the least magical. Worked in my project like a charm.
                                            – ba3a
                                            Sep 11 '17 at 20:22










                                          • I tried it but it didn't work on its own. I also had to Invalidate the Cashes. File > Cashes / Restart
                                            – Lukasz
                                            Sep 20 '17 at 21:00










                                          • I tried it and also invalidated the cashes. But still doesn't work.
                                            – wings
                                            Dec 27 '17 at 11:11










                                          • This worked for me after I remembered to click the obvious ok button instead of just closing the dialog box :-)
                                            – rimsky
                                            Feb 7 '18 at 0:07












                                          • I dont see any "Specific instrumentation runner" entry in my Android Studio.
                                            – david
                                            Feb 26 '18 at 13:33
















                                          I think in most cases your solution would be the most universal and the least magical. Worked in my project like a charm.
                                          – ba3a
                                          Sep 11 '17 at 20:22




                                          I think in most cases your solution would be the most universal and the least magical. Worked in my project like a charm.
                                          – ba3a
                                          Sep 11 '17 at 20:22












                                          I tried it but it didn't work on its own. I also had to Invalidate the Cashes. File > Cashes / Restart
                                          – Lukasz
                                          Sep 20 '17 at 21:00




                                          I tried it but it didn't work on its own. I also had to Invalidate the Cashes. File > Cashes / Restart
                                          – Lukasz
                                          Sep 20 '17 at 21:00












                                          I tried it and also invalidated the cashes. But still doesn't work.
                                          – wings
                                          Dec 27 '17 at 11:11




                                          I tried it and also invalidated the cashes. But still doesn't work.
                                          – wings
                                          Dec 27 '17 at 11:11












                                          This worked for me after I remembered to click the obvious ok button instead of just closing the dialog box :-)
                                          – rimsky
                                          Feb 7 '18 at 0:07






                                          This worked for me after I remembered to click the obvious ok button instead of just closing the dialog box :-)
                                          – rimsky
                                          Feb 7 '18 at 0:07














                                          I dont see any "Specific instrumentation runner" entry in my Android Studio.
                                          – david
                                          Feb 26 '18 at 13:33




                                          I dont see any "Specific instrumentation runner" entry in my Android Studio.
                                          – david
                                          Feb 26 '18 at 13:33













                                          38














                                          I went to



                                          File -> Invalidate Caches/Restart...


                                          and then it worked for me.






                                          share|improve this answer

















                                          • 3




                                            I did this, and then also had to delete the test configurations.
                                            – Johan Henkens
                                            May 2 '18 at 16:40
















                                          38














                                          I went to



                                          File -> Invalidate Caches/Restart...


                                          and then it worked for me.






                                          share|improve this answer

















                                          • 3




                                            I did this, and then also had to delete the test configurations.
                                            – Johan Henkens
                                            May 2 '18 at 16:40














                                          38












                                          38








                                          38






                                          I went to



                                          File -> Invalidate Caches/Restart...


                                          and then it worked for me.






                                          share|improve this answer












                                          I went to



                                          File -> Invalidate Caches/Restart...


                                          and then it worked for me.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Nov 2 '17 at 20:16









                                          user674669

                                          2,25932237




                                          2,25932237








                                          • 3




                                            I did this, and then also had to delete the test configurations.
                                            – Johan Henkens
                                            May 2 '18 at 16:40














                                          • 3




                                            I did this, and then also had to delete the test configurations.
                                            – Johan Henkens
                                            May 2 '18 at 16:40








                                          3




                                          3




                                          I did this, and then also had to delete the test configurations.
                                          – Johan Henkens
                                          May 2 '18 at 16:40




                                          I did this, and then also had to delete the test configurations.
                                          – Johan Henkens
                                          May 2 '18 at 16:40











                                          31














                                          I had the same issue. I rebuilded project, and it helped me.



                                          Go to Build --> Rebuild Project



                                          After then, if you are using Maven tool, I recommend use option Reimport All Maven Projects




                                          If it not help, try another possible solutions:




                                          • Go to File-->Invalidate Caches/Restart--> Invalidate and Restart


                                          or:




                                          • In your Maven project structure src/main/java right click on java directory and select option Mark directory as --> Sources Root

                                            Similarly do the same with test directory so: src/test/java right click on java directory and select option Mark directory as --> Test
                                            Sources Root




                                          or:




                                          • Go to Run --> Edit Configurations and in section JUnit remove test configurations. Apply changes. After then try to run your tests. New configuration should be created automatically.


                                          or:




                                          • Go to File --> Project Structure, select Modules, then select your proper module and go to the Paths tab.
                                            Check options:
                                            Radio button Use module compile output path should be selected.

                                            Output path should be inside your project. Also Test output path should be directory inside your project. For example it can look similarly:
                                            Output path: C:pathtoyourmoduleyourModule targetclasses
                                            Test Output path: C:pathtoyourmoduleyourModule targettest-classes

                                            Exclude output paths should be deselected.






                                          share|improve this answer

















                                          • 5




                                            Rebuilding the project (Build -> Rebuild Project) was what worked for me. Thank you!
                                            – Francisco C.
                                            Mar 21 '18 at 20:07










                                          • This solution worked for me, the last thing about the modules and using an output path. Thanks.
                                            – Mohammad Ganji
                                            Nov 10 '18 at 10:50










                                          • As a more desperate solution, delete the .idea file and open the project again. You will lose some configuration/settings, however.
                                            – Aaron
                                            Nov 22 '18 at 22:27
















                                          31














                                          I had the same issue. I rebuilded project, and it helped me.



                                          Go to Build --> Rebuild Project



                                          After then, if you are using Maven tool, I recommend use option Reimport All Maven Projects




                                          If it not help, try another possible solutions:




                                          • Go to File-->Invalidate Caches/Restart--> Invalidate and Restart


                                          or:




                                          • In your Maven project structure src/main/java right click on java directory and select option Mark directory as --> Sources Root

                                            Similarly do the same with test directory so: src/test/java right click on java directory and select option Mark directory as --> Test
                                            Sources Root




                                          or:




                                          • Go to Run --> Edit Configurations and in section JUnit remove test configurations. Apply changes. After then try to run your tests. New configuration should be created automatically.


                                          or:




                                          • Go to File --> Project Structure, select Modules, then select your proper module and go to the Paths tab.
                                            Check options:
                                            Radio button Use module compile output path should be selected.

                                            Output path should be inside your project. Also Test output path should be directory inside your project. For example it can look similarly:
                                            Output path: C:pathtoyourmoduleyourModule targetclasses
                                            Test Output path: C:pathtoyourmoduleyourModule targettest-classes

                                            Exclude output paths should be deselected.






                                          share|improve this answer

















                                          • 5




                                            Rebuilding the project (Build -> Rebuild Project) was what worked for me. Thank you!
                                            – Francisco C.
                                            Mar 21 '18 at 20:07










                                          • This solution worked for me, the last thing about the modules and using an output path. Thanks.
                                            – Mohammad Ganji
                                            Nov 10 '18 at 10:50










                                          • As a more desperate solution, delete the .idea file and open the project again. You will lose some configuration/settings, however.
                                            – Aaron
                                            Nov 22 '18 at 22:27














                                          31












                                          31








                                          31






                                          I had the same issue. I rebuilded project, and it helped me.



                                          Go to Build --> Rebuild Project



                                          After then, if you are using Maven tool, I recommend use option Reimport All Maven Projects




                                          If it not help, try another possible solutions:




                                          • Go to File-->Invalidate Caches/Restart--> Invalidate and Restart


                                          or:




                                          • In your Maven project structure src/main/java right click on java directory and select option Mark directory as --> Sources Root

                                            Similarly do the same with test directory so: src/test/java right click on java directory and select option Mark directory as --> Test
                                            Sources Root




                                          or:




                                          • Go to Run --> Edit Configurations and in section JUnit remove test configurations. Apply changes. After then try to run your tests. New configuration should be created automatically.


                                          or:




                                          • Go to File --> Project Structure, select Modules, then select your proper module and go to the Paths tab.
                                            Check options:
                                            Radio button Use module compile output path should be selected.

                                            Output path should be inside your project. Also Test output path should be directory inside your project. For example it can look similarly:
                                            Output path: C:pathtoyourmoduleyourModule targetclasses
                                            Test Output path: C:pathtoyourmoduleyourModule targettest-classes

                                            Exclude output paths should be deselected.






                                          share|improve this answer












                                          I had the same issue. I rebuilded project, and it helped me.



                                          Go to Build --> Rebuild Project



                                          After then, if you are using Maven tool, I recommend use option Reimport All Maven Projects




                                          If it not help, try another possible solutions:




                                          • Go to File-->Invalidate Caches/Restart--> Invalidate and Restart


                                          or:




                                          • In your Maven project structure src/main/java right click on java directory and select option Mark directory as --> Sources Root

                                            Similarly do the same with test directory so: src/test/java right click on java directory and select option Mark directory as --> Test
                                            Sources Root




                                          or:




                                          • Go to Run --> Edit Configurations and in section JUnit remove test configurations. Apply changes. After then try to run your tests. New configuration should be created automatically.


                                          or:




                                          • Go to File --> Project Structure, select Modules, then select your proper module and go to the Paths tab.
                                            Check options:
                                            Radio button Use module compile output path should be selected.

                                            Output path should be inside your project. Also Test output path should be directory inside your project. For example it can look similarly:
                                            Output path: C:pathtoyourmoduleyourModule targetclasses
                                            Test Output path: C:pathtoyourmoduleyourModule targettest-classes

                                            Exclude output paths should be deselected.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Jan 23 '18 at 7:27









                                          Schakal

                                          36138




                                          36138








                                          • 5




                                            Rebuilding the project (Build -> Rebuild Project) was what worked for me. Thank you!
                                            – Francisco C.
                                            Mar 21 '18 at 20:07










                                          • This solution worked for me, the last thing about the modules and using an output path. Thanks.
                                            – Mohammad Ganji
                                            Nov 10 '18 at 10:50










                                          • As a more desperate solution, delete the .idea file and open the project again. You will lose some configuration/settings, however.
                                            – Aaron
                                            Nov 22 '18 at 22:27














                                          • 5




                                            Rebuilding the project (Build -> Rebuild Project) was what worked for me. Thank you!
                                            – Francisco C.
                                            Mar 21 '18 at 20:07










                                          • This solution worked for me, the last thing about the modules and using an output path. Thanks.
                                            – Mohammad Ganji
                                            Nov 10 '18 at 10:50










                                          • As a more desperate solution, delete the .idea file and open the project again. You will lose some configuration/settings, however.
                                            – Aaron
                                            Nov 22 '18 at 22:27








                                          5




                                          5




                                          Rebuilding the project (Build -> Rebuild Project) was what worked for me. Thank you!
                                          – Francisco C.
                                          Mar 21 '18 at 20:07




                                          Rebuilding the project (Build -> Rebuild Project) was what worked for me. Thank you!
                                          – Francisco C.
                                          Mar 21 '18 at 20:07












                                          This solution worked for me, the last thing about the modules and using an output path. Thanks.
                                          – Mohammad Ganji
                                          Nov 10 '18 at 10:50




                                          This solution worked for me, the last thing about the modules and using an output path. Thanks.
                                          – Mohammad Ganji
                                          Nov 10 '18 at 10:50












                                          As a more desperate solution, delete the .idea file and open the project again. You will lose some configuration/settings, however.
                                          – Aaron
                                          Nov 22 '18 at 22:27




                                          As a more desperate solution, delete the .idea file and open the project again. You will lose some configuration/settings, however.
                                          – Aaron
                                          Nov 22 '18 at 22:27











                                          14














                                          This might also happen, if your test folder has been imported as a separate module (a small square is shown on the folder icon in the project view).

                                          Remove the module by selecting the test folder in the project view and press DEL.

                                          Then start your test.

                                          If a popup dialog appears with an error message, that no module is selected, specify your root module from the dropdown.






                                          share|improve this answer

















                                          • 3




                                            This was my problem also (square on test folder - would not have known what that meant!); to fix, I opened the run configuration and found that "Use class path of module:" was set to the test module. I changed it to the class path of my project instead, and it worked fine. Thanks for pointing out the "separate module" gotcha!
                                            – Redboots
                                            Nov 30 '17 at 23:40










                                          • This is exactly what happened to me. I created a Spring project using start.spring.io and opened it. Afterwards I started the SpringBootTest and ran into the the "Class not found: "..."Empty test suite" error. After following your solution and pressing the DELETE button on test folder and recreating run configuration everything was fine. Additional hint: When pressing delete button on test folder a dialog comes up saying something like "no files will be deleted". So no fear pressing the button.
                                            – stritzi
                                            Nov 21 '18 at 17:24
















                                          14














                                          This might also happen, if your test folder has been imported as a separate module (a small square is shown on the folder icon in the project view).

                                          Remove the module by selecting the test folder in the project view and press DEL.

                                          Then start your test.

                                          If a popup dialog appears with an error message, that no module is selected, specify your root module from the dropdown.






                                          share|improve this answer

















                                          • 3




                                            This was my problem also (square on test folder - would not have known what that meant!); to fix, I opened the run configuration and found that "Use class path of module:" was set to the test module. I changed it to the class path of my project instead, and it worked fine. Thanks for pointing out the "separate module" gotcha!
                                            – Redboots
                                            Nov 30 '17 at 23:40










                                          • This is exactly what happened to me. I created a Spring project using start.spring.io and opened it. Afterwards I started the SpringBootTest and ran into the the "Class not found: "..."Empty test suite" error. After following your solution and pressing the DELETE button on test folder and recreating run configuration everything was fine. Additional hint: When pressing delete button on test folder a dialog comes up saying something like "no files will be deleted". So no fear pressing the button.
                                            – stritzi
                                            Nov 21 '18 at 17:24














                                          14












                                          14








                                          14






                                          This might also happen, if your test folder has been imported as a separate module (a small square is shown on the folder icon in the project view).

                                          Remove the module by selecting the test folder in the project view and press DEL.

                                          Then start your test.

                                          If a popup dialog appears with an error message, that no module is selected, specify your root module from the dropdown.






                                          share|improve this answer












                                          This might also happen, if your test folder has been imported as a separate module (a small square is shown on the folder icon in the project view).

                                          Remove the module by selecting the test folder in the project view and press DEL.

                                          Then start your test.

                                          If a popup dialog appears with an error message, that no module is selected, specify your root module from the dropdown.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Nov 3 '16 at 11:16









                                          Tobi

                                          1,0241426




                                          1,0241426








                                          • 3




                                            This was my problem also (square on test folder - would not have known what that meant!); to fix, I opened the run configuration and found that "Use class path of module:" was set to the test module. I changed it to the class path of my project instead, and it worked fine. Thanks for pointing out the "separate module" gotcha!
                                            – Redboots
                                            Nov 30 '17 at 23:40










                                          • This is exactly what happened to me. I created a Spring project using start.spring.io and opened it. Afterwards I started the SpringBootTest and ran into the the "Class not found: "..."Empty test suite" error. After following your solution and pressing the DELETE button on test folder and recreating run configuration everything was fine. Additional hint: When pressing delete button on test folder a dialog comes up saying something like "no files will be deleted". So no fear pressing the button.
                                            – stritzi
                                            Nov 21 '18 at 17:24














                                          • 3




                                            This was my problem also (square on test folder - would not have known what that meant!); to fix, I opened the run configuration and found that "Use class path of module:" was set to the test module. I changed it to the class path of my project instead, and it worked fine. Thanks for pointing out the "separate module" gotcha!
                                            – Redboots
                                            Nov 30 '17 at 23:40










                                          • This is exactly what happened to me. I created a Spring project using start.spring.io and opened it. Afterwards I started the SpringBootTest and ran into the the "Class not found: "..."Empty test suite" error. After following your solution and pressing the DELETE button on test folder and recreating run configuration everything was fine. Additional hint: When pressing delete button on test folder a dialog comes up saying something like "no files will be deleted". So no fear pressing the button.
                                            – stritzi
                                            Nov 21 '18 at 17:24








                                          3




                                          3




                                          This was my problem also (square on test folder - would not have known what that meant!); to fix, I opened the run configuration and found that "Use class path of module:" was set to the test module. I changed it to the class path of my project instead, and it worked fine. Thanks for pointing out the "separate module" gotcha!
                                          – Redboots
                                          Nov 30 '17 at 23:40




                                          This was my problem also (square on test folder - would not have known what that meant!); to fix, I opened the run configuration and found that "Use class path of module:" was set to the test module. I changed it to the class path of my project instead, and it worked fine. Thanks for pointing out the "separate module" gotcha!
                                          – Redboots
                                          Nov 30 '17 at 23:40












                                          This is exactly what happened to me. I created a Spring project using start.spring.io and opened it. Afterwards I started the SpringBootTest and ran into the the "Class not found: "..."Empty test suite" error. After following your solution and pressing the DELETE button on test folder and recreating run configuration everything was fine. Additional hint: When pressing delete button on test folder a dialog comes up saying something like "no files will be deleted". So no fear pressing the button.
                                          – stritzi
                                          Nov 21 '18 at 17:24




                                          This is exactly what happened to me. I created a Spring project using start.spring.io and opened it. Afterwards I started the SpringBootTest and ran into the the "Class not found: "..."Empty test suite" error. After following your solution and pressing the DELETE button on test folder and recreating run configuration everything was fine. Additional hint: When pressing delete button on test folder a dialog comes up saying something like "no files will be deleted". So no fear pressing the button.
                                          – stritzi
                                          Nov 21 '18 at 17:24











                                          11














                                          I had a similar problem after starting a new IntelliJ project. I found that the "module compile output path" for my module was not properly specified. When I assigned the path in the module's "compile output path" to the proper location, the problem was solved. The compile output path is assigned in the Project settings. Under Modules, select the module involved and select the Paths tab...



                                          Paths tab in the Project Settings | Modules dialog



                                          screenshot



                                          ...I sent the compiler output to a folder named "output" that is present in the parent Project folder.






                                          share|improve this answer




























                                            11














                                            I had a similar problem after starting a new IntelliJ project. I found that the "module compile output path" for my module was not properly specified. When I assigned the path in the module's "compile output path" to the proper location, the problem was solved. The compile output path is assigned in the Project settings. Under Modules, select the module involved and select the Paths tab...



                                            Paths tab in the Project Settings | Modules dialog



                                            screenshot



                                            ...I sent the compiler output to a folder named "output" that is present in the parent Project folder.






                                            share|improve this answer


























                                              11












                                              11








                                              11






                                              I had a similar problem after starting a new IntelliJ project. I found that the "module compile output path" for my module was not properly specified. When I assigned the path in the module's "compile output path" to the proper location, the problem was solved. The compile output path is assigned in the Project settings. Under Modules, select the module involved and select the Paths tab...



                                              Paths tab in the Project Settings | Modules dialog



                                              screenshot



                                              ...I sent the compiler output to a folder named "output" that is present in the parent Project folder.






                                              share|improve this answer














                                              I had a similar problem after starting a new IntelliJ project. I found that the "module compile output path" for my module was not properly specified. When I assigned the path in the module's "compile output path" to the proper location, the problem was solved. The compile output path is assigned in the Project settings. Under Modules, select the module involved and select the Paths tab...



                                              Paths tab in the Project Settings | Modules dialog



                                              screenshot



                                              ...I sent the compiler output to a folder named "output" that is present in the parent Project folder.







                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited Feb 3 '17 at 15:18









                                              rhgb

                                              2,93611524




                                              2,93611524










                                              answered Feb 3 '17 at 14:43









                                              DStanton

                                              11112




                                              11112























                                                  8














                                                  So, my issue here was with folder names. I had called my code folder Classes 2016/2017, which IntelliJ didn't like. Simply remove the slash (or other offending character in path), re-import the project, and you'll be good to go!






                                                  share|improve this answer





















                                                  • This helped me. For others, I had the folder in Dropbox. When I moved it out of Dropbox and re-imported, the problem went away.
                                                    – Mick Sear
                                                    Feb 8 '17 at 11:31










                                                  • This answer deserves a nobel peace prize!
                                                    – Ali Abbas Jaffri
                                                    Oct 25 '17 at 15:24
















                                                  8














                                                  So, my issue here was with folder names. I had called my code folder Classes 2016/2017, which IntelliJ didn't like. Simply remove the slash (or other offending character in path), re-import the project, and you'll be good to go!






                                                  share|improve this answer





















                                                  • This helped me. For others, I had the folder in Dropbox. When I moved it out of Dropbox and re-imported, the problem went away.
                                                    – Mick Sear
                                                    Feb 8 '17 at 11:31










                                                  • This answer deserves a nobel peace prize!
                                                    – Ali Abbas Jaffri
                                                    Oct 25 '17 at 15:24














                                                  8












                                                  8








                                                  8






                                                  So, my issue here was with folder names. I had called my code folder Classes 2016/2017, which IntelliJ didn't like. Simply remove the slash (or other offending character in path), re-import the project, and you'll be good to go!






                                                  share|improve this answer












                                                  So, my issue here was with folder names. I had called my code folder Classes 2016/2017, which IntelliJ didn't like. Simply remove the slash (or other offending character in path), re-import the project, and you'll be good to go!







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Sep 2 '16 at 21:06









                                                  arnbobo

                                                  1,0352513




                                                  1,0352513












                                                  • This helped me. For others, I had the folder in Dropbox. When I moved it out of Dropbox and re-imported, the problem went away.
                                                    – Mick Sear
                                                    Feb 8 '17 at 11:31










                                                  • This answer deserves a nobel peace prize!
                                                    – Ali Abbas Jaffri
                                                    Oct 25 '17 at 15:24


















                                                  • This helped me. For others, I had the folder in Dropbox. When I moved it out of Dropbox and re-imported, the problem went away.
                                                    – Mick Sear
                                                    Feb 8 '17 at 11:31










                                                  • This answer deserves a nobel peace prize!
                                                    – Ali Abbas Jaffri
                                                    Oct 25 '17 at 15:24
















                                                  This helped me. For others, I had the folder in Dropbox. When I moved it out of Dropbox and re-imported, the problem went away.
                                                  – Mick Sear
                                                  Feb 8 '17 at 11:31




                                                  This helped me. For others, I had the folder in Dropbox. When I moved it out of Dropbox and re-imported, the problem went away.
                                                  – Mick Sear
                                                  Feb 8 '17 at 11:31












                                                  This answer deserves a nobel peace prize!
                                                  – Ali Abbas Jaffri
                                                  Oct 25 '17 at 15:24




                                                  This answer deserves a nobel peace prize!
                                                  – Ali Abbas Jaffri
                                                  Oct 25 '17 at 15:24











                                                  7














                                                  In Android Studio 3.0 +, sometimes UI tests are somehow interpreted as unit tests and it doesn't ask for target deployment selection. You can go to Edit Configuration and mark it as an Integration test and it would start working






                                                  share|improve this answer





















                                                  • Also, on Android Studio 3.0.1 the run button next to the test doesn't work. After updating to 3.1 canary 8 it did start working again.
                                                    – Marc
                                                    Jan 19 '18 at 10:30
















                                                  7














                                                  In Android Studio 3.0 +, sometimes UI tests are somehow interpreted as unit tests and it doesn't ask for target deployment selection. You can go to Edit Configuration and mark it as an Integration test and it would start working






                                                  share|improve this answer





















                                                  • Also, on Android Studio 3.0.1 the run button next to the test doesn't work. After updating to 3.1 canary 8 it did start working again.
                                                    – Marc
                                                    Jan 19 '18 at 10:30














                                                  7












                                                  7








                                                  7






                                                  In Android Studio 3.0 +, sometimes UI tests are somehow interpreted as unit tests and it doesn't ask for target deployment selection. You can go to Edit Configuration and mark it as an Integration test and it would start working






                                                  share|improve this answer












                                                  In Android Studio 3.0 +, sometimes UI tests are somehow interpreted as unit tests and it doesn't ask for target deployment selection. You can go to Edit Configuration and mark it as an Integration test and it would start working







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Nov 30 '17 at 19:40









                                                  Tushar Nallan

                                                  604613




                                                  604613












                                                  • Also, on Android Studio 3.0.1 the run button next to the test doesn't work. After updating to 3.1 canary 8 it did start working again.
                                                    – Marc
                                                    Jan 19 '18 at 10:30


















                                                  • Also, on Android Studio 3.0.1 the run button next to the test doesn't work. After updating to 3.1 canary 8 it did start working again.
                                                    – Marc
                                                    Jan 19 '18 at 10:30
















                                                  Also, on Android Studio 3.0.1 the run button next to the test doesn't work. After updating to 3.1 canary 8 it did start working again.
                                                  – Marc
                                                  Jan 19 '18 at 10:30




                                                  Also, on Android Studio 3.0.1 the run button next to the test doesn't work. After updating to 3.1 canary 8 it did start working again.
                                                  – Marc
                                                  Jan 19 '18 at 10:30











                                                  5














                                                  I had the same question when I import some jar from Maven, and subsequently, cause the empty-test-suite error.



                                                  In my case, it was because the maven resetting the module files. Which I resolved by clearing my default configuration:




                                                  1. Open Project structure with shift-ctrl-alt-s shortcut


                                                  Screenshot of PModules Sources




                                                  1. Look at the Modules > Sources and fill the Sources package or test Package.






                                                  share|improve this answer




























                                                    5














                                                    I had the same question when I import some jar from Maven, and subsequently, cause the empty-test-suite error.



                                                    In my case, it was because the maven resetting the module files. Which I resolved by clearing my default configuration:




                                                    1. Open Project structure with shift-ctrl-alt-s shortcut


                                                    Screenshot of PModules Sources




                                                    1. Look at the Modules > Sources and fill the Sources package or test Package.






                                                    share|improve this answer


























                                                      5












                                                      5








                                                      5






                                                      I had the same question when I import some jar from Maven, and subsequently, cause the empty-test-suite error.



                                                      In my case, it was because the maven resetting the module files. Which I resolved by clearing my default configuration:




                                                      1. Open Project structure with shift-ctrl-alt-s shortcut


                                                      Screenshot of PModules Sources




                                                      1. Look at the Modules > Sources and fill the Sources package or test Package.






                                                      share|improve this answer














                                                      I had the same question when I import some jar from Maven, and subsequently, cause the empty-test-suite error.



                                                      In my case, it was because the maven resetting the module files. Which I resolved by clearing my default configuration:




                                                      1. Open Project structure with shift-ctrl-alt-s shortcut


                                                      Screenshot of PModules Sources




                                                      1. Look at the Modules > Sources and fill the Sources package or test Package.







                                                      share|improve this answer














                                                      share|improve this answer



                                                      share|improve this answer








                                                      edited Apr 30 '17 at 16:06









                                                      Richard Slater

                                                      4,76833973




                                                      4,76833973










                                                      answered Apr 30 '17 at 15:27









                                                      tyrantqiao

                                                      8116




                                                      8116























                                                          4














                                                          This will also happen when your module- and/or project-jdk aren't properly configured.






                                                          share|improve this answer


























                                                            4














                                                            This will also happen when your module- and/or project-jdk aren't properly configured.






                                                            share|improve this answer
























                                                              4












                                                              4








                                                              4






                                                              This will also happen when your module- and/or project-jdk aren't properly configured.






                                                              share|improve this answer












                                                              This will also happen when your module- and/or project-jdk aren't properly configured.







                                                              share|improve this answer












                                                              share|improve this answer



                                                              share|improve this answer










                                                              answered Nov 7 '16 at 10:38









                                                              Maarten Dhondt

                                                              163315




                                                              163315























                                                                  4














                                                                  Reimport project or module can solve the issue.
                                                                  I made this issue by renaming package name when developing. But the out path and test output path is the old path. So intellij can't find the class from the old path.
                                                                  So the easiest way is correcting the out path and test output path.



                                                                  Intellij module setting






                                                                  share|improve this answer























                                                                  • For some reason inherit project path doesn't work for me on MacOs, do you have any ideas why it can be happeningn?
                                                                    – Johnny_D
                                                                    Jun 22 '18 at 18:46










                                                                  • @Johnny_D Are you sure your issue is due to rename package?
                                                                    – Bejond
                                                                    Jun 25 '18 at 8:59


















                                                                  4














                                                                  Reimport project or module can solve the issue.
                                                                  I made this issue by renaming package name when developing. But the out path and test output path is the old path. So intellij can't find the class from the old path.
                                                                  So the easiest way is correcting the out path and test output path.



                                                                  Intellij module setting






                                                                  share|improve this answer























                                                                  • For some reason inherit project path doesn't work for me on MacOs, do you have any ideas why it can be happeningn?
                                                                    – Johnny_D
                                                                    Jun 22 '18 at 18:46










                                                                  • @Johnny_D Are you sure your issue is due to rename package?
                                                                    – Bejond
                                                                    Jun 25 '18 at 8:59
















                                                                  4












                                                                  4








                                                                  4






                                                                  Reimport project or module can solve the issue.
                                                                  I made this issue by renaming package name when developing. But the out path and test output path is the old path. So intellij can't find the class from the old path.
                                                                  So the easiest way is correcting the out path and test output path.



                                                                  Intellij module setting






                                                                  share|improve this answer














                                                                  Reimport project or module can solve the issue.
                                                                  I made this issue by renaming package name when developing. But the out path and test output path is the old path. So intellij can't find the class from the old path.
                                                                  So the easiest way is correcting the out path and test output path.



                                                                  Intellij module setting







                                                                  share|improve this answer














                                                                  share|improve this answer



                                                                  share|improve this answer








                                                                  edited Aug 23 '17 at 3:15

























                                                                  answered Aug 22 '17 at 7:53









                                                                  Bejond

                                                                  890515




                                                                  890515












                                                                  • For some reason inherit project path doesn't work for me on MacOs, do you have any ideas why it can be happeningn?
                                                                    – Johnny_D
                                                                    Jun 22 '18 at 18:46










                                                                  • @Johnny_D Are you sure your issue is due to rename package?
                                                                    – Bejond
                                                                    Jun 25 '18 at 8:59




















                                                                  • For some reason inherit project path doesn't work for me on MacOs, do you have any ideas why it can be happeningn?
                                                                    – Johnny_D
                                                                    Jun 22 '18 at 18:46










                                                                  • @Johnny_D Are you sure your issue is due to rename package?
                                                                    – Bejond
                                                                    Jun 25 '18 at 8:59


















                                                                  For some reason inherit project path doesn't work for me on MacOs, do you have any ideas why it can be happeningn?
                                                                  – Johnny_D
                                                                  Jun 22 '18 at 18:46




                                                                  For some reason inherit project path doesn't work for me on MacOs, do you have any ideas why it can be happeningn?
                                                                  – Johnny_D
                                                                  Jun 22 '18 at 18:46












                                                                  @Johnny_D Are you sure your issue is due to rename package?
                                                                  – Bejond
                                                                  Jun 25 '18 at 8:59






                                                                  @Johnny_D Are you sure your issue is due to rename package?
                                                                  – Bejond
                                                                  Jun 25 '18 at 8:59













                                                                  3














                                                                  I had the same problem and rebuilding/invalidating cache etc. didn't work. Seems like that's just a bug in Android Studio...



                                                                  A temporary solution is just to run your unit tests from the command line with:



                                                                  ./gradlew test


                                                                  See: https://developer.android.com/studio/test/command-line.html






                                                                  share|improve this answer


























                                                                    3














                                                                    I had the same problem and rebuilding/invalidating cache etc. didn't work. Seems like that's just a bug in Android Studio...



                                                                    A temporary solution is just to run your unit tests from the command line with:



                                                                    ./gradlew test


                                                                    See: https://developer.android.com/studio/test/command-line.html






                                                                    share|improve this answer
























                                                                      3












                                                                      3








                                                                      3






                                                                      I had the same problem and rebuilding/invalidating cache etc. didn't work. Seems like that's just a bug in Android Studio...



                                                                      A temporary solution is just to run your unit tests from the command line with:



                                                                      ./gradlew test


                                                                      See: https://developer.android.com/studio/test/command-line.html






                                                                      share|improve this answer












                                                                      I had the same problem and rebuilding/invalidating cache etc. didn't work. Seems like that's just a bug in Android Studio...



                                                                      A temporary solution is just to run your unit tests from the command line with:



                                                                      ./gradlew test


                                                                      See: https://developer.android.com/studio/test/command-line.html







                                                                      share|improve this answer












                                                                      share|improve this answer



                                                                      share|improve this answer










                                                                      answered Mar 5 '18 at 13:02









                                                                      Marius

                                                                      1,6681438




                                                                      1,6681438























                                                                          3














                                                                          I had the same issue (Android Studio 3.2 Canary 4) and I tried most of suggestions described in other answers - without any success. Note this happened after I moved the file from test to androidTest folder. It was still shown in run configurations as test instead of instrumented test.



                                                                          I finally end up with creating a new file:





                                                                          1. Create new instrumented test class with different name.

                                                                          2. Copy all the code from your class.

                                                                          3. Run it.

                                                                          4. Delete the old class.

                                                                          5. Rename new class to desired name.







                                                                          share|improve this answer


























                                                                            3














                                                                            I had the same issue (Android Studio 3.2 Canary 4) and I tried most of suggestions described in other answers - without any success. Note this happened after I moved the file from test to androidTest folder. It was still shown in run configurations as test instead of instrumented test.



                                                                            I finally end up with creating a new file:





                                                                            1. Create new instrumented test class with different name.

                                                                            2. Copy all the code from your class.

                                                                            3. Run it.

                                                                            4. Delete the old class.

                                                                            5. Rename new class to desired name.







                                                                            share|improve this answer
























                                                                              3












                                                                              3








                                                                              3






                                                                              I had the same issue (Android Studio 3.2 Canary 4) and I tried most of suggestions described in other answers - without any success. Note this happened after I moved the file from test to androidTest folder. It was still shown in run configurations as test instead of instrumented test.



                                                                              I finally end up with creating a new file:





                                                                              1. Create new instrumented test class with different name.

                                                                              2. Copy all the code from your class.

                                                                              3. Run it.

                                                                              4. Delete the old class.

                                                                              5. Rename new class to desired name.







                                                                              share|improve this answer












                                                                              I had the same issue (Android Studio 3.2 Canary 4) and I tried most of suggestions described in other answers - without any success. Note this happened after I moved the file from test to androidTest folder. It was still shown in run configurations as test instead of instrumented test.



                                                                              I finally end up with creating a new file:





                                                                              1. Create new instrumented test class with different name.

                                                                              2. Copy all the code from your class.

                                                                              3. Run it.

                                                                              4. Delete the old class.

                                                                              5. Rename new class to desired name.








                                                                              share|improve this answer












                                                                              share|improve this answer



                                                                              share|improve this answer










                                                                              answered Mar 7 '18 at 15:32









                                                                              Micer

                                                                              4,47424052




                                                                              4,47424052























                                                                                  3














                                                                                  In my case, I had everything else in the right place, but I was working on a java library with kotlin.
                                                                                  I just forgot to apply the plugin:



                                                                                  apply plugin: 'kotlin-android'


                                                                                  And now it's working as expected now.






                                                                                  share|improve this answer




























                                                                                    3














                                                                                    In my case, I had everything else in the right place, but I was working on a java library with kotlin.
                                                                                    I just forgot to apply the plugin:



                                                                                    apply plugin: 'kotlin-android'


                                                                                    And now it's working as expected now.






                                                                                    share|improve this answer


























                                                                                      3












                                                                                      3








                                                                                      3






                                                                                      In my case, I had everything else in the right place, but I was working on a java library with kotlin.
                                                                                      I just forgot to apply the plugin:



                                                                                      apply plugin: 'kotlin-android'


                                                                                      And now it's working as expected now.






                                                                                      share|improve this answer














                                                                                      In my case, I had everything else in the right place, but I was working on a java library with kotlin.
                                                                                      I just forgot to apply the plugin:



                                                                                      apply plugin: 'kotlin-android'


                                                                                      And now it's working as expected now.







                                                                                      share|improve this answer














                                                                                      share|improve this answer



                                                                                      share|improve this answer








                                                                                      edited Jul 20 '18 at 10:13

























                                                                                      answered Jul 10 '18 at 8:11









                                                                                      crgarridos

                                                                                      3,45721333




                                                                                      3,45721333























                                                                                          2














                                                                                          Deleting .idea and re-importing the SBT project solved this issue for me.






                                                                                          share|improve this answer





















                                                                                          • It works after deleting the .idea folder and re-importing the maven project (y)
                                                                                            – Amine Soumiaa
                                                                                            Apr 5 '18 at 12:21
















                                                                                          2














                                                                                          Deleting .idea and re-importing the SBT project solved this issue for me.






                                                                                          share|improve this answer





















                                                                                          • It works after deleting the .idea folder and re-importing the maven project (y)
                                                                                            – Amine Soumiaa
                                                                                            Apr 5 '18 at 12:21














                                                                                          2












                                                                                          2








                                                                                          2






                                                                                          Deleting .idea and re-importing the SBT project solved this issue for me.






                                                                                          share|improve this answer












                                                                                          Deleting .idea and re-importing the SBT project solved this issue for me.







                                                                                          share|improve this answer












                                                                                          share|improve this answer



                                                                                          share|improve this answer










                                                                                          answered May 8 '17 at 11:01









                                                                                          jhegedus

                                                                                          9,027754115




                                                                                          9,027754115












                                                                                          • It works after deleting the .idea folder and re-importing the maven project (y)
                                                                                            – Amine Soumiaa
                                                                                            Apr 5 '18 at 12:21


















                                                                                          • It works after deleting the .idea folder and re-importing the maven project (y)
                                                                                            – Amine Soumiaa
                                                                                            Apr 5 '18 at 12:21
















                                                                                          It works after deleting the .idea folder and re-importing the maven project (y)
                                                                                          – Amine Soumiaa
                                                                                          Apr 5 '18 at 12:21




                                                                                          It works after deleting the .idea folder and re-importing the maven project (y)
                                                                                          – Amine Soumiaa
                                                                                          Apr 5 '18 at 12:21











                                                                                          2














                                                                                          Interestingly, I've faced this issue many times due to different reasons. For e.g. Invalidating cache and restarting has helped as well.



                                                                                          Last I fixed it by correcting my output path in File -> Project Structure -> Project -> Project Compiler Output to : absolute_path_of_package/out



                                                                                          for e.g. : /Users/random-guy/myWorkspace/src/DummyProject/out






                                                                                          share|improve this answer


























                                                                                            2














                                                                                            Interestingly, I've faced this issue many times due to different reasons. For e.g. Invalidating cache and restarting has helped as well.



                                                                                            Last I fixed it by correcting my output path in File -> Project Structure -> Project -> Project Compiler Output to : absolute_path_of_package/out



                                                                                            for e.g. : /Users/random-guy/myWorkspace/src/DummyProject/out






                                                                                            share|improve this answer
























                                                                                              2












                                                                                              2








                                                                                              2






                                                                                              Interestingly, I've faced this issue many times due to different reasons. For e.g. Invalidating cache and restarting has helped as well.



                                                                                              Last I fixed it by correcting my output path in File -> Project Structure -> Project -> Project Compiler Output to : absolute_path_of_package/out



                                                                                              for e.g. : /Users/random-guy/myWorkspace/src/DummyProject/out






                                                                                              share|improve this answer












                                                                                              Interestingly, I've faced this issue many times due to different reasons. For e.g. Invalidating cache and restarting has helped as well.



                                                                                              Last I fixed it by correcting my output path in File -> Project Structure -> Project -> Project Compiler Output to : absolute_path_of_package/out



                                                                                              for e.g. : /Users/random-guy/myWorkspace/src/DummyProject/out







                                                                                              share|improve this answer












                                                                                              share|improve this answer



                                                                                              share|improve this answer










                                                                                              answered Mar 27 '18 at 0:31









                                                                                              some random guy

                                                                                              15917




                                                                                              15917























                                                                                                  1














                                                                                                  I had the same issue. In my case i had some test classes in a package/folder outside of the main folder. But when i checked the Run configuration, it was always trying to look for classes inside the main folder (and not my packages outside of main) .
                                                                                                  So if that is the case , you either have to move your packages to where the Run configuration is pointing to.
                                                                                                  Or change the run configuration to point to your packages.






                                                                                                  share|improve this answer


























                                                                                                    1














                                                                                                    I had the same issue. In my case i had some test classes in a package/folder outside of the main folder. But when i checked the Run configuration, it was always trying to look for classes inside the main folder (and not my packages outside of main) .
                                                                                                    So if that is the case , you either have to move your packages to where the Run configuration is pointing to.
                                                                                                    Or change the run configuration to point to your packages.






                                                                                                    share|improve this answer
























                                                                                                      1












                                                                                                      1








                                                                                                      1






                                                                                                      I had the same issue. In my case i had some test classes in a package/folder outside of the main folder. But when i checked the Run configuration, it was always trying to look for classes inside the main folder (and not my packages outside of main) .
                                                                                                      So if that is the case , you either have to move your packages to where the Run configuration is pointing to.
                                                                                                      Or change the run configuration to point to your packages.






                                                                                                      share|improve this answer












                                                                                                      I had the same issue. In my case i had some test classes in a package/folder outside of the main folder. But when i checked the Run configuration, it was always trying to look for classes inside the main folder (and not my packages outside of main) .
                                                                                                      So if that is the case , you either have to move your packages to where the Run configuration is pointing to.
                                                                                                      Or change the run configuration to point to your packages.







                                                                                                      share|improve this answer












                                                                                                      share|improve this answer



                                                                                                      share|improve this answer










                                                                                                      answered Dec 21 '16 at 21:56









                                                                                                      mykey

                                                                                                      12714




                                                                                                      12714























                                                                                                          1














                                                                                                          Does your test require an Android device (emulator or hardware)?

                                                                                                          If so, it's called an "instrumented test" and resides in "module-name/src/androidTest/java/".

                                                                                                          If not, it's called a "local unit test" and resides in "module-name/src/test/java"



                                                                                                          https://developer.android.com/training/testing/start/index.html



                                                                                                          I got the same error because I had written a local unit test, but it was placed in the folder for instrumented tests. Moving the local unit test to the "src/test/java" folder fixed it for me.






                                                                                                          share|improve this answer


























                                                                                                            1














                                                                                                            Does your test require an Android device (emulator or hardware)?

                                                                                                            If so, it's called an "instrumented test" and resides in "module-name/src/androidTest/java/".

                                                                                                            If not, it's called a "local unit test" and resides in "module-name/src/test/java"



                                                                                                            https://developer.android.com/training/testing/start/index.html



                                                                                                            I got the same error because I had written a local unit test, but it was placed in the folder for instrumented tests. Moving the local unit test to the "src/test/java" folder fixed it for me.






                                                                                                            share|improve this answer
























                                                                                                              1












                                                                                                              1








                                                                                                              1






                                                                                                              Does your test require an Android device (emulator or hardware)?

                                                                                                              If so, it's called an "instrumented test" and resides in "module-name/src/androidTest/java/".

                                                                                                              If not, it's called a "local unit test" and resides in "module-name/src/test/java"



                                                                                                              https://developer.android.com/training/testing/start/index.html



                                                                                                              I got the same error because I had written a local unit test, but it was placed in the folder for instrumented tests. Moving the local unit test to the "src/test/java" folder fixed it for me.






                                                                                                              share|improve this answer












                                                                                                              Does your test require an Android device (emulator or hardware)?

                                                                                                              If so, it's called an "instrumented test" and resides in "module-name/src/androidTest/java/".

                                                                                                              If not, it's called a "local unit test" and resides in "module-name/src/test/java"



                                                                                                              https://developer.android.com/training/testing/start/index.html



                                                                                                              I got the same error because I had written a local unit test, but it was placed in the folder for instrumented tests. Moving the local unit test to the "src/test/java" folder fixed it for me.







                                                                                                              share|improve this answer












                                                                                                              share|improve this answer



                                                                                                              share|improve this answer










                                                                                                              answered Apr 2 '17 at 4:02









                                                                                                              Patrick

                                                                                                              35119




                                                                                                              35119























                                                                                                                  1














                                                                                                                  Was getting same error. My device was not connected to android studio. When I connected to studio. It works. This solves my problem.






                                                                                                                  share|improve this answer


























                                                                                                                    1














                                                                                                                    Was getting same error. My device was not connected to android studio. When I connected to studio. It works. This solves my problem.






                                                                                                                    share|improve this answer
























                                                                                                                      1












                                                                                                                      1








                                                                                                                      1






                                                                                                                      Was getting same error. My device was not connected to android studio. When I connected to studio. It works. This solves my problem.






                                                                                                                      share|improve this answer












                                                                                                                      Was getting same error. My device was not connected to android studio. When I connected to studio. It works. This solves my problem.







                                                                                                                      share|improve this answer












                                                                                                                      share|improve this answer



                                                                                                                      share|improve this answer










                                                                                                                      answered Apr 2 '17 at 17:20









                                                                                                                      Aman Srii

                                                                                                                      245415




                                                                                                                      245415























                                                                                                                          1














                                                                                                                          It's probably because the folder is not set as test source, which can be done via Module Settings > Modules.






                                                                                                                          share|improve this answer


























                                                                                                                            1














                                                                                                                            It's probably because the folder is not set as test source, which can be done via Module Settings > Modules.






                                                                                                                            share|improve this answer
























                                                                                                                              1












                                                                                                                              1








                                                                                                                              1






                                                                                                                              It's probably because the folder is not set as test source, which can be done via Module Settings > Modules.






                                                                                                                              share|improve this answer












                                                                                                                              It's probably because the folder is not set as test source, which can be done via Module Settings > Modules.







                                                                                                                              share|improve this answer












                                                                                                                              share|improve this answer



                                                                                                                              share|improve this answer










                                                                                                                              answered May 15 '17 at 15:22









                                                                                                                              noego

                                                                                                                              2,84011613




                                                                                                                              2,84011613























                                                                                                                                  1














                                                                                                                                  In my case, the problem was fixed by going into my build.gradle and changing



                                                                                                                                  dependencies {
                                                                                                                                  testImplementation 'junit:junit:4.12'
                                                                                                                                  }


                                                                                                                                  to



                                                                                                                                  dependencies {
                                                                                                                                  testCompile 'junit:junit:4.12'
                                                                                                                                  }





                                                                                                                                  share|improve this answer





















                                                                                                                                  • This helped for me too, surprisingly.Looks like it forced a recompile. Tried several cleanups/cache before without help
                                                                                                                                    – Dieter Menne
                                                                                                                                    Dec 8 '17 at 8:20










                                                                                                                                  • For what it is worth, the issue for me was fixed like the solution I propose above. However, the reason was that I was using a plugin that did not support the 'implementation' command. So I would suggest that you may want to see if some of your project's plugins have updates as well. Perhaps a better approach would be to update the plugin since Gradle wants to deprecate the "compile" command
                                                                                                                                    – bremen_matt
                                                                                                                                    Dec 8 '17 at 8:41
















                                                                                                                                  1














                                                                                                                                  In my case, the problem was fixed by going into my build.gradle and changing



                                                                                                                                  dependencies {
                                                                                                                                  testImplementation 'junit:junit:4.12'
                                                                                                                                  }


                                                                                                                                  to



                                                                                                                                  dependencies {
                                                                                                                                  testCompile 'junit:junit:4.12'
                                                                                                                                  }





                                                                                                                                  share|improve this answer





















                                                                                                                                  • This helped for me too, surprisingly.Looks like it forced a recompile. Tried several cleanups/cache before without help
                                                                                                                                    – Dieter Menne
                                                                                                                                    Dec 8 '17 at 8:20










                                                                                                                                  • For what it is worth, the issue for me was fixed like the solution I propose above. However, the reason was that I was using a plugin that did not support the 'implementation' command. So I would suggest that you may want to see if some of your project's plugins have updates as well. Perhaps a better approach would be to update the plugin since Gradle wants to deprecate the "compile" command
                                                                                                                                    – bremen_matt
                                                                                                                                    Dec 8 '17 at 8:41














                                                                                                                                  1












                                                                                                                                  1








                                                                                                                                  1






                                                                                                                                  In my case, the problem was fixed by going into my build.gradle and changing



                                                                                                                                  dependencies {
                                                                                                                                  testImplementation 'junit:junit:4.12'
                                                                                                                                  }


                                                                                                                                  to



                                                                                                                                  dependencies {
                                                                                                                                  testCompile 'junit:junit:4.12'
                                                                                                                                  }





                                                                                                                                  share|improve this answer












                                                                                                                                  In my case, the problem was fixed by going into my build.gradle and changing



                                                                                                                                  dependencies {
                                                                                                                                  testImplementation 'junit:junit:4.12'
                                                                                                                                  }


                                                                                                                                  to



                                                                                                                                  dependencies {
                                                                                                                                  testCompile 'junit:junit:4.12'
                                                                                                                                  }






                                                                                                                                  share|improve this answer












                                                                                                                                  share|improve this answer



                                                                                                                                  share|improve this answer










                                                                                                                                  answered Sep 29 '17 at 9:48









                                                                                                                                  bremen_matt

                                                                                                                                  2,39621836




                                                                                                                                  2,39621836












                                                                                                                                  • This helped for me too, surprisingly.Looks like it forced a recompile. Tried several cleanups/cache before without help
                                                                                                                                    – Dieter Menne
                                                                                                                                    Dec 8 '17 at 8:20










                                                                                                                                  • For what it is worth, the issue for me was fixed like the solution I propose above. However, the reason was that I was using a plugin that did not support the 'implementation' command. So I would suggest that you may want to see if some of your project's plugins have updates as well. Perhaps a better approach would be to update the plugin since Gradle wants to deprecate the "compile" command
                                                                                                                                    – bremen_matt
                                                                                                                                    Dec 8 '17 at 8:41


















                                                                                                                                  • This helped for me too, surprisingly.Looks like it forced a recompile. Tried several cleanups/cache before without help
                                                                                                                                    – Dieter Menne
                                                                                                                                    Dec 8 '17 at 8:20










                                                                                                                                  • For what it is worth, the issue for me was fixed like the solution I propose above. However, the reason was that I was using a plugin that did not support the 'implementation' command. So I would suggest that you may want to see if some of your project's plugins have updates as well. Perhaps a better approach would be to update the plugin since Gradle wants to deprecate the "compile" command
                                                                                                                                    – bremen_matt
                                                                                                                                    Dec 8 '17 at 8:41
















                                                                                                                                  This helped for me too, surprisingly.Looks like it forced a recompile. Tried several cleanups/cache before without help
                                                                                                                                  – Dieter Menne
                                                                                                                                  Dec 8 '17 at 8:20




                                                                                                                                  This helped for me too, surprisingly.Looks like it forced a recompile. Tried several cleanups/cache before without help
                                                                                                                                  – Dieter Menne
                                                                                                                                  Dec 8 '17 at 8:20












                                                                                                                                  For what it is worth, the issue for me was fixed like the solution I propose above. However, the reason was that I was using a plugin that did not support the 'implementation' command. So I would suggest that you may want to see if some of your project's plugins have updates as well. Perhaps a better approach would be to update the plugin since Gradle wants to deprecate the "compile" command
                                                                                                                                  – bremen_matt
                                                                                                                                  Dec 8 '17 at 8:41




                                                                                                                                  For what it is worth, the issue for me was fixed like the solution I propose above. However, the reason was that I was using a plugin that did not support the 'implementation' command. So I would suggest that you may want to see if some of your project's plugins have updates as well. Perhaps a better approach would be to update the plugin since Gradle wants to deprecate the "compile" command
                                                                                                                                  – bremen_matt
                                                                                                                                  Dec 8 '17 at 8:41











                                                                                                                                  1














                                                                                                                                  In my case, IntelliJ didn't compile the test sources for a strange reason. I simply modified the build configuration and added the maven goal clean test-compile in the Before launch section






                                                                                                                                  share|improve this answer





















                                                                                                                                  • Tried all the above, but only this helped :) Thank you!
                                                                                                                                    – Antenka
                                                                                                                                    May 16 '18 at 18:11
















                                                                                                                                  1














                                                                                                                                  In my case, IntelliJ didn't compile the test sources for a strange reason. I simply modified the build configuration and added the maven goal clean test-compile in the Before launch section






                                                                                                                                  share|improve this answer





















                                                                                                                                  • Tried all the above, but only this helped :) Thank you!
                                                                                                                                    – Antenka
                                                                                                                                    May 16 '18 at 18:11














                                                                                                                                  1












                                                                                                                                  1








                                                                                                                                  1






                                                                                                                                  In my case, IntelliJ didn't compile the test sources for a strange reason. I simply modified the build configuration and added the maven goal clean test-compile in the Before launch section






                                                                                                                                  share|improve this answer












                                                                                                                                  In my case, IntelliJ didn't compile the test sources for a strange reason. I simply modified the build configuration and added the maven goal clean test-compile in the Before launch section







                                                                                                                                  share|improve this answer












                                                                                                                                  share|improve this answer



                                                                                                                                  share|improve this answer










                                                                                                                                  answered Oct 15 '17 at 0:35









                                                                                                                                  vatbub

                                                                                                                                  836519




                                                                                                                                  836519












                                                                                                                                  • Tried all the above, but only this helped :) Thank you!
                                                                                                                                    – Antenka
                                                                                                                                    May 16 '18 at 18:11


















                                                                                                                                  • Tried all the above, but only this helped :) Thank you!
                                                                                                                                    – Antenka
                                                                                                                                    May 16 '18 at 18:11
















                                                                                                                                  Tried all the above, but only this helped :) Thank you!
                                                                                                                                  – Antenka
                                                                                                                                  May 16 '18 at 18:11




                                                                                                                                  Tried all the above, but only this helped :) Thank you!
                                                                                                                                  – Antenka
                                                                                                                                  May 16 '18 at 18:11











                                                                                                                                  1














                                                                                                                                  I tried all solutions but none of them helped. At the end i run test in debug mode and.... it started to work. Maybe some maven's cache was cleared up. It is difficult to say. It works. Try mvn test -X






                                                                                                                                  share|improve this answer


























                                                                                                                                    1














                                                                                                                                    I tried all solutions but none of them helped. At the end i run test in debug mode and.... it started to work. Maybe some maven's cache was cleared up. It is difficult to say. It works. Try mvn test -X






                                                                                                                                    share|improve this answer
























                                                                                                                                      1












                                                                                                                                      1








                                                                                                                                      1






                                                                                                                                      I tried all solutions but none of them helped. At the end i run test in debug mode and.... it started to work. Maybe some maven's cache was cleared up. It is difficult to say. It works. Try mvn test -X






                                                                                                                                      share|improve this answer












                                                                                                                                      I tried all solutions but none of them helped. At the end i run test in debug mode and.... it started to work. Maybe some maven's cache was cleared up. It is difficult to say. It works. Try mvn test -X







                                                                                                                                      share|improve this answer












                                                                                                                                      share|improve this answer



                                                                                                                                      share|improve this answer










                                                                                                                                      answered Feb 9 '18 at 8:51









                                                                                                                                      radekpakula

                                                                                                                                      794




                                                                                                                                      794























                                                                                                                                          1














                                                                                                                                          Just click your mouse right button on the file in Projects windows and select



                                                                                                                                          "Run YourTest".



                                                                                                                                          Everything just starts OK now, probably because faulty run configuration is being rebuild anew.






                                                                                                                                          share|improve this answer


























                                                                                                                                            1














                                                                                                                                            Just click your mouse right button on the file in Projects windows and select



                                                                                                                                            "Run YourTest".



                                                                                                                                            Everything just starts OK now, probably because faulty run configuration is being rebuild anew.






                                                                                                                                            share|improve this answer
























                                                                                                                                              1












                                                                                                                                              1








                                                                                                                                              1






                                                                                                                                              Just click your mouse right button on the file in Projects windows and select



                                                                                                                                              "Run YourTest".



                                                                                                                                              Everything just starts OK now, probably because faulty run configuration is being rebuild anew.






                                                                                                                                              share|improve this answer












                                                                                                                                              Just click your mouse right button on the file in Projects windows and select



                                                                                                                                              "Run YourTest".



                                                                                                                                              Everything just starts OK now, probably because faulty run configuration is being rebuild anew.







                                                                                                                                              share|improve this answer












                                                                                                                                              share|improve this answer



                                                                                                                                              share|improve this answer










                                                                                                                                              answered Feb 22 '18 at 14:50









                                                                                                                                              WebComer

                                                                                                                                              456517




                                                                                                                                              456517























                                                                                                                                                  1














                                                                                                                                                  This can happen (at least once for me ;) after installing the new version of IntelliJ and the IntelliJ plugins have not yet updated.



                                                                                                                                                  You may have to manually do the Check for updates… from IntelliJ Help menu.






                                                                                                                                                  share|improve this answer




























                                                                                                                                                    1














                                                                                                                                                    This can happen (at least once for me ;) after installing the new version of IntelliJ and the IntelliJ plugins have not yet updated.



                                                                                                                                                    You may have to manually do the Check for updates… from IntelliJ Help menu.






                                                                                                                                                    share|improve this answer


























                                                                                                                                                      1












                                                                                                                                                      1








                                                                                                                                                      1






                                                                                                                                                      This can happen (at least once for me ;) after installing the new version of IntelliJ and the IntelliJ plugins have not yet updated.



                                                                                                                                                      You may have to manually do the Check for updates… from IntelliJ Help menu.






                                                                                                                                                      share|improve this answer














                                                                                                                                                      This can happen (at least once for me ;) after installing the new version of IntelliJ and the IntelliJ plugins have not yet updated.



                                                                                                                                                      You may have to manually do the Check for updates… from IntelliJ Help menu.







                                                                                                                                                      share|improve this answer














                                                                                                                                                      share|improve this answer



                                                                                                                                                      share|improve this answer








                                                                                                                                                      edited Jun 14 '18 at 11:57









                                                                                                                                                      ToDo

                                                                                                                                                      3021922




                                                                                                                                                      3021922










                                                                                                                                                      answered Apr 7 '18 at 4:55









                                                                                                                                                      Peter Lamberg

                                                                                                                                                      3,64513150




                                                                                                                                                      3,64513150























                                                                                                                                                          0














                                                                                                                                                          Same issue here using IDEA 15.0.6, and nothing helped except when I renamed the package the test class was in. Afterwards I renamed it back to its original name and it still worked, so the rename action might have cleared some cache.






                                                                                                                                                          share|improve this answer


























                                                                                                                                                            0














                                                                                                                                                            Same issue here using IDEA 15.0.6, and nothing helped except when I renamed the package the test class was in. Afterwards I renamed it back to its original name and it still worked, so the rename action might have cleared some cache.






                                                                                                                                                            share|improve this answer
























                                                                                                                                                              0












                                                                                                                                                              0








                                                                                                                                                              0






                                                                                                                                                              Same issue here using IDEA 15.0.6, and nothing helped except when I renamed the package the test class was in. Afterwards I renamed it back to its original name and it still worked, so the rename action might have cleared some cache.






                                                                                                                                                              share|improve this answer












                                                                                                                                                              Same issue here using IDEA 15.0.6, and nothing helped except when I renamed the package the test class was in. Afterwards I renamed it back to its original name and it still worked, so the rename action might have cleared some cache.







                                                                                                                                                              share|improve this answer












                                                                                                                                                              share|improve this answer



                                                                                                                                                              share|improve this answer










                                                                                                                                                              answered Dec 6 '16 at 23:44









                                                                                                                                                              Alexander Klimetschek

                                                                                                                                                              2,6662033




                                                                                                                                                              2,6662033























                                                                                                                                                                  0














                                                                                                                                                                  For me it was because my project was being compiled into a directory outside of the project. In paths the output paths were productionproject_name and testproject_name which was putting them in C:productionproject_name. Changing them to the full path of the project allowed my tests to access the class files.






                                                                                                                                                                  share|improve this answer


























                                                                                                                                                                    0














                                                                                                                                                                    For me it was because my project was being compiled into a directory outside of the project. In paths the output paths were productionproject_name and testproject_name which was putting them in C:productionproject_name. Changing them to the full path of the project allowed my tests to access the class files.






                                                                                                                                                                    share|improve this answer
























                                                                                                                                                                      0












                                                                                                                                                                      0








                                                                                                                                                                      0






                                                                                                                                                                      For me it was because my project was being compiled into a directory outside of the project. In paths the output paths were productionproject_name and testproject_name which was putting them in C:productionproject_name. Changing them to the full path of the project allowed my tests to access the class files.






                                                                                                                                                                      share|improve this answer












                                                                                                                                                                      For me it was because my project was being compiled into a directory outside of the project. In paths the output paths were productionproject_name and testproject_name which was putting them in C:productionproject_name. Changing them to the full path of the project allowed my tests to access the class files.







                                                                                                                                                                      share|improve this answer












                                                                                                                                                                      share|improve this answer



                                                                                                                                                                      share|improve this answer










                                                                                                                                                                      answered Mar 6 '17 at 16:44









                                                                                                                                                                      seharri

                                                                                                                                                                      1




                                                                                                                                                                      1























                                                                                                                                                                          0














                                                                                                                                                                          I had the same issue in my environment also (MacOS). I was using IntelliJ 2016. I had a Java library project (gradle).



                                                                                                                                                                          What I did was




                                                                                                                                                                          1. Opened/exported project from a IntelliJ older version (like IntelliJ14).
                                                                                                                                                                            This happened successfully and I verified it with by making the project and by running a test case.

                                                                                                                                                                          2. Then I imported that project again via IntelliJ 2016.
                                                                                                                                                                            After that it worked fine(building and test case running).






                                                                                                                                                                          share|improve this answer


























                                                                                                                                                                            0














                                                                                                                                                                            I had the same issue in my environment also (MacOS). I was using IntelliJ 2016. I had a Java library project (gradle).



                                                                                                                                                                            What I did was




                                                                                                                                                                            1. Opened/exported project from a IntelliJ older version (like IntelliJ14).
                                                                                                                                                                              This happened successfully and I verified it with by making the project and by running a test case.

                                                                                                                                                                            2. Then I imported that project again via IntelliJ 2016.
                                                                                                                                                                              After that it worked fine(building and test case running).






                                                                                                                                                                            share|improve this answer
























                                                                                                                                                                              0












                                                                                                                                                                              0








                                                                                                                                                                              0






                                                                                                                                                                              I had the same issue in my environment also (MacOS). I was using IntelliJ 2016. I had a Java library project (gradle).



                                                                                                                                                                              What I did was




                                                                                                                                                                              1. Opened/exported project from a IntelliJ older version (like IntelliJ14).
                                                                                                                                                                                This happened successfully and I verified it with by making the project and by running a test case.

                                                                                                                                                                              2. Then I imported that project again via IntelliJ 2016.
                                                                                                                                                                                After that it worked fine(building and test case running).






                                                                                                                                                                              share|improve this answer












                                                                                                                                                                              I had the same issue in my environment also (MacOS). I was using IntelliJ 2016. I had a Java library project (gradle).



                                                                                                                                                                              What I did was




                                                                                                                                                                              1. Opened/exported project from a IntelliJ older version (like IntelliJ14).
                                                                                                                                                                                This happened successfully and I verified it with by making the project and by running a test case.

                                                                                                                                                                              2. Then I imported that project again via IntelliJ 2016.
                                                                                                                                                                                After that it worked fine(building and test case running).







                                                                                                                                                                              share|improve this answer












                                                                                                                                                                              share|improve this answer



                                                                                                                                                                              share|improve this answer










                                                                                                                                                                              answered Apr 18 '17 at 9:08









                                                                                                                                                                              udayanga

                                                                                                                                                                              876




                                                                                                                                                                              876























                                                                                                                                                                                  0














                                                                                                                                                                                  What worked for me was right click on the Project folder -> Maven -> Generate Sources and Update Folders






                                                                                                                                                                                  share|improve this answer


























                                                                                                                                                                                    0














                                                                                                                                                                                    What worked for me was right click on the Project folder -> Maven -> Generate Sources and Update Folders






                                                                                                                                                                                    share|improve this answer
























                                                                                                                                                                                      0












                                                                                                                                                                                      0








                                                                                                                                                                                      0






                                                                                                                                                                                      What worked for me was right click on the Project folder -> Maven -> Generate Sources and Update Folders






                                                                                                                                                                                      share|improve this answer












                                                                                                                                                                                      What worked for me was right click on the Project folder -> Maven -> Generate Sources and Update Folders







                                                                                                                                                                                      share|improve this answer












                                                                                                                                                                                      share|improve this answer



                                                                                                                                                                                      share|improve this answer










                                                                                                                                                                                      answered Aug 7 '17 at 13:55









                                                                                                                                                                                      jsmiao

                                                                                                                                                                                      758




                                                                                                                                                                                      758























                                                                                                                                                                                          0














                                                                                                                                                                                          For me the project was compiled outside the project. I just change the path.
                                                                                                                                                                                          For changing the path (i'm using mac).




                                                                                                                                                                                          • Go to File --> Project Structure

                                                                                                                                                                                          • Go to Module on left side.

                                                                                                                                                                                          • Select Paths, select radio button(use module compile output path)

                                                                                                                                                                                          • Provide output path and Test output path which is inside your project

                                                                                                                                                                                          • Deselect Exclude output paths.

                                                                                                                                                                                          • Go to File --> Click on Invalidate Cache and restart






                                                                                                                                                                                          share|improve this answer


























                                                                                                                                                                                            0














                                                                                                                                                                                            For me the project was compiled outside the project. I just change the path.
                                                                                                                                                                                            For changing the path (i'm using mac).




                                                                                                                                                                                            • Go to File --> Project Structure

                                                                                                                                                                                            • Go to Module on left side.

                                                                                                                                                                                            • Select Paths, select radio button(use module compile output path)

                                                                                                                                                                                            • Provide output path and Test output path which is inside your project

                                                                                                                                                                                            • Deselect Exclude output paths.

                                                                                                                                                                                            • Go to File --> Click on Invalidate Cache and restart






                                                                                                                                                                                            share|improve this answer
























                                                                                                                                                                                              0












                                                                                                                                                                                              0








                                                                                                                                                                                              0






                                                                                                                                                                                              For me the project was compiled outside the project. I just change the path.
                                                                                                                                                                                              For changing the path (i'm using mac).




                                                                                                                                                                                              • Go to File --> Project Structure

                                                                                                                                                                                              • Go to Module on left side.

                                                                                                                                                                                              • Select Paths, select radio button(use module compile output path)

                                                                                                                                                                                              • Provide output path and Test output path which is inside your project

                                                                                                                                                                                              • Deselect Exclude output paths.

                                                                                                                                                                                              • Go to File --> Click on Invalidate Cache and restart






                                                                                                                                                                                              share|improve this answer












                                                                                                                                                                                              For me the project was compiled outside the project. I just change the path.
                                                                                                                                                                                              For changing the path (i'm using mac).




                                                                                                                                                                                              • Go to File --> Project Structure

                                                                                                                                                                                              • Go to Module on left side.

                                                                                                                                                                                              • Select Paths, select radio button(use module compile output path)

                                                                                                                                                                                              • Provide output path and Test output path which is inside your project

                                                                                                                                                                                              • Deselect Exclude output paths.

                                                                                                                                                                                              • Go to File --> Click on Invalidate Cache and restart







                                                                                                                                                                                              share|improve this answer












                                                                                                                                                                                              share|improve this answer



                                                                                                                                                                                              share|improve this answer










                                                                                                                                                                                              answered Sep 19 '17 at 14:46









                                                                                                                                                                                              Mukul Aggarwal

                                                                                                                                                                                              734910




                                                                                                                                                                                              734910























                                                                                                                                                                                                  0














                                                                                                                                                                                                  My fix for this issue was with folder names and paths.



                                                                                                                                                                                                  My test were missing /java/ folder for some reason and IntelliJ didn't like that.



                                                                                                                                                                                                  so from
                                                                                                                                                                                                  ../test/com/..
                                                                                                                                                                                                  to
                                                                                                                                                                                                  ../test/java/com/..



                                                                                                                                                                                                  and it is ok






                                                                                                                                                                                                  share|improve this answer


























                                                                                                                                                                                                    0














                                                                                                                                                                                                    My fix for this issue was with folder names and paths.



                                                                                                                                                                                                    My test were missing /java/ folder for some reason and IntelliJ didn't like that.



                                                                                                                                                                                                    so from
                                                                                                                                                                                                    ../test/com/..
                                                                                                                                                                                                    to
                                                                                                                                                                                                    ../test/java/com/..



                                                                                                                                                                                                    and it is ok






                                                                                                                                                                                                    share|improve this answer
























                                                                                                                                                                                                      0












                                                                                                                                                                                                      0








                                                                                                                                                                                                      0






                                                                                                                                                                                                      My fix for this issue was with folder names and paths.



                                                                                                                                                                                                      My test were missing /java/ folder for some reason and IntelliJ didn't like that.



                                                                                                                                                                                                      so from
                                                                                                                                                                                                      ../test/com/..
                                                                                                                                                                                                      to
                                                                                                                                                                                                      ../test/java/com/..



                                                                                                                                                                                                      and it is ok






                                                                                                                                                                                                      share|improve this answer












                                                                                                                                                                                                      My fix for this issue was with folder names and paths.



                                                                                                                                                                                                      My test were missing /java/ folder for some reason and IntelliJ didn't like that.



                                                                                                                                                                                                      so from
                                                                                                                                                                                                      ../test/com/..
                                                                                                                                                                                                      to
                                                                                                                                                                                                      ../test/java/com/..



                                                                                                                                                                                                      and it is ok







                                                                                                                                                                                                      share|improve this answer












                                                                                                                                                                                                      share|improve this answer



                                                                                                                                                                                                      share|improve this answer










                                                                                                                                                                                                      answered Feb 5 '18 at 12:59









                                                                                                                                                                                                      Evgeni Atanasov

                                                                                                                                                                                                      1218




                                                                                                                                                                                                      1218






















                                                                                                                                                                                                          1 2
                                                                                                                                                                                                          next




                                                                                                                                                                                                          protected by Michael Roland Jul 24 '18 at 5:50



                                                                                                                                                                                                          Thank you for your interest in this question.
                                                                                                                                                                                                          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                                                                                                                                                                                          Would you like to answer one of these unanswered questions instead?



                                                                                                                                                                                                          Popular posts from this blog

                                                                                                                                                                                                          Wiesbaden

                                                                                                                                                                                                          Marschland

                                                                                                                                                                                                          Dieringhausen