启动通过Espresso Test Recording记录的仪器测试后,出现此错误。
"Custom runner class AndroidJUnit4 should have a public constructor with signature AndroidJUnit4(Class testClass)"
我试图通过添加以下依赖关系来解决此问题:
androidTestCompile 'androidx.test:runner:1.1.0'
androidTestCompile 'androidx.test:rules:1.1.0'
// Optional -- Hamcrest library
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with Espresso
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
// Optional -- UI testing with UI Automator
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
还有android部分
android{
useLibrary 'android.test.mock'
defaultConfig {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}
我的测试放置在androidTest文件夹内。 我该怎么做才能解决我的问题?