如果Android Studio无法记录Robo测试,可能是由于以下原因导致的:
dependencies {
// ...
testImplementation 'org.robolectric:robolectric:4.3'
}
dependencies {
// ...
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
}
@RunWith(RobolectricTestRunner.class)
@Config(sdk = Build.VERSION_CODES.P)
public class ExampleUnitTest {
// ...
}
这些解决方法可以帮助你解决Android Studio无法记录Robo测试的问题。如果问题仍然存在,请检查Android Studio的日志或控制台输出,以获取更多的错误信息,并尝试搜索相关的解决方案。