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
I had to update a Gradle settings file according to these instructions. I just added the line
testImplementation 'junit:junit:4.12'
to the dependencies
block of my app's build.gradle
file. If you check the "Project" tab in Android studio (where you can see your source code files) there should be a "Gradle Scripts" section. Look for the build.gradle
file named after your package and add that line to the dependencies
block, then click the "Sync now" prompt that should come up.
Solved the issue. I was running the JUnit tests as a standard "JUnit test" in Android Studio
. I fixed the issue by resetting the configuration as a Android Test
.