gradle looks like:
apply plugin: \'com.android.application\'
android {
compileSdkVersion 25
buildToolsVersion \"25.0.2\"
defaultConfig {
I had the same problem. I'm working in Android studio 2.3.1. I checked my run configurations. Under Run->Edit Configurations and discovered the test I was trying to run as an instrumented test was under the Android JUnit tests category, even though I had it in the androidTest directory in my project. I added an Android Instrumented Test (hit the plus button in the corner) and set it to point to the test I was trying to run. That fixed it for me.