切换到AndroidX
并收到弃用的:import androidx.test.InstrumentationRegistry
。
如果我做了下一个导入:import androidx.test.platform.app.InstrumentationRegistry
,我就不能使用getContext()
了。
例如:val context = InstrumentationRegistry.getContext()
。
在build.gradle
中
androidTestImplementation 'androidx.test.ext:junit:1.0.0-beta02'
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
https://stackoverflow.com/questions/52924431
复制相似问题