Android Studio cannot resolve org.junit
Try File -> Invalidate Caches / Restart
.
Put this in your gradle file:
testCompile 'junit:junit:4.12'
If none of the above work, it might be that your test classes are in the wrong directory.
I ran into this issue because my text classes were in the /main/java
dir instead of the /test
dir where they're supposed to be...
In short:
Make sure your test classes are in the /test
directory!