Search code examples
androidmockitopowermockito

warning using mockito-android


I got this warning using mockito

You included the 'mockito-android' dependency in a non-Android environment. The Android mock maker was disabled. You should only include the latter in your 'androidTestCompile' configuration If disabling was a mistake, you can set the 'org.mockito.mock.android' property to 'true' to override this detection.

where could I set the property that the message say?

what is this error about?


Solution

  • It seems that for testImplementation we should use mockito-core and for androidTestImplementation mockito-android

    Mockito Documentation