I've spent several hours trying to make Robolectric in Android Studio, with no success, and I'm almost up to give it up. I get the following error:
!!! JUnit version 3.8 or later expected:
java.lang.RuntimeException: Stub!
Of course I use a junit version newer than 3.8 (4.11, indeed).
I've tried several tricks founds in other questions related to this, such as:
- move the junit dependency to be the first one as suggested somewhere,
- tried gradle tricks such as changing the sourceSets.instrumentationtest.setRoot, classpath, dependencies -> instrumentTestCompile, apply plugin: 'android-unit-test', but the Gradle version included in my Android Studio version (0.5.7) doesn't seem to recognize these tags.
I even downloaded examples from GitHub that don't even compile. So I'm getting really tired of this.
Any ideas?