Class not found: Empty test suite when running unit tests in Android Studio
I had a similar problem and it was because I first created an Unit Test with the same class name. When I created the Instrumented Unit Test I got the error.
To solve it, I went to Edit Configurations, on the left of the run icon. Then below Unit Test, it was the 'conflicting' class, which I deleted. Click on Apply/Ok. Then I right click on the class name, click on run and voilà, it works.
The fix on Android Studio is:
- step 1.- Go to Run/Debug configuration
- step 2.- Go to Android Tests section
- step 3.- Remove the test configuration file with (-)
- step 4.- Press Apply and OK
- step 5.- Run the test again