Skip to content Skip to sidebar Skip to footer

What Do I Need Enable Or Install To Get The Annotation @runwith

I want to create a simple test with Robolectric for Android Apps using Android Studio. Ok, it is my build.gradle on root directory: buildscript { repositories { jcente

Solution 1:

It is already there:

testCompile 'junit:junit:4.12'

The only one thing to do in Android studio is to switch from instrumental tests to unit tests: enter image description here

Solution 2:

It is in the Android test support library. Add the following to your dependencies:

androidTestCompile 'com.android.support.test:runner:0.3'

Post a Comment for "What Do I Need Enable Or Install To Get The Annotation @runwith"