Tried out the suggestions on this post, but I still get the error:
!!! JUnit version 3.8 or later expected: java.lang.RuntimeException: Stub! at junit.r
Running an "Android JUNit" config and having JUnit 4.12 in gradle did not help to resolve this.
I needed to select JRE to Android API 27 Platform in the run config manually instead of "Default" to resolve the issue.
JRE
Android API 27 Platform