Attempt to mockito mock any class generates ExceptionInInitializerError

前端 未结 7 1493
無奈伤痛
無奈伤痛 2020-12-16 09:26

When I run the following code:

public class ActivityTest extends ActivityInstrumentationTestCase2 {
    ....
    public void testCanCreat         


        
7条回答
  •  离开以前
    2020-12-16 09:59

    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'.

提交回复
热议问题