When I run the following code:
public class ActivityTest extends ActivityInstrumentationTestCase2 { .... public void testCanCreat
I stumbled upon the same error and could make it work by using
androidTestImplementation 'org.mockito:mockito-android:2.18.3'
in my build.gradle.
I previously made the mistake to only import 'org.mockito:mockito-core:2.18.3'.
'org.mockito:mockito-core:2.18.3'