Starting 0 tests on test(AVD) - 10
Tests on test(AVD) - 10 failed: Instrumentation run failed due to 'Process crashed.'
com.android.build.gradle.internal.testing.ConnectedDevice > No tests found.[test(AVD) - 10] FAILED
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).
所以我在 CI 上运行测试,这个错误随机弹出,有时它会找到 2 个测试并运行它。但大多数时候我都会得到这个。
对我来说,当仪器测试的测试运行程序错误时,就会发生这种情况。我变了
android {
// ...
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
// ...
}
to
android {
// ...
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// ...
}
请注意,我使用了 KTS(构建.gradle.kts)但这对于问题来说应该不重要,语法只是略有不同。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)