Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.support.test cannot be resolved

I'm trying to create tests using Espresso and Mockito

in order to do that, I have to add the following import:

import android.support.test.runner.AndroidJUnit4;

For some reason I'm getting "Cannot resolve symbol 'test'"

Any idea what could cause this? Am I missing a dependency?

(My gradle file contains, between the rest, the following dependencies):

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
like image 346
Cookienator Avatar asked Sep 03 '26 07:09

Cookienator


1 Answers

I don't know if you solved this, but I realized I was on the release build variant, where the testing stuff doesn't work. I switched back to debug and everything was fine.

like image 152
nasch Avatar answered Sep 05 '26 21:09

nasch