In the line 25 of ExampleInstrumentedTest.kt file, val appContext = InstrumentationRegistry.getTargetContext() should be replaced by val appContext = InstrumentationRegistry.getInstrumentation().getTargetContext() cause of the 'InstrumentationRegistry' is deprecated in Java, otherwise, the gradle cannot be built.
In the line 25 of ExampleInstrumentedTest.kt file,
val appContext = InstrumentationRegistry.getTargetContext()
should be replaced byval appContext = InstrumentationRegistry.getInstrumentation().getTargetContext()
cause of the 'InstrumentationRegistry' is deprecated in Java, otherwise, the gradle cannot be built.