I've encountered the same issue and the thing that helped me was that I had defined the Roboelectric dependency twice in Gradle file one with androidTestImplementation and the other with testImplementation so when I removed the first part problem solved!!!