【发布时间】:2021-05-01 17:07:34
【问题描述】:
我所有的 androidTests 错误:
05/01 21:24:26: Launching 'ExampleInstrumentedT...' on Nexus 5 API R.
Install successfully finished in 1 s 870 ms.
Running tests
$ adb shell am instrument -w -m -e debug false -e class 'com.mrahimy.mytestapplication10.ExampleInstrumentedTest' com.mrahimy.mytestapplication10.test/androidx.test.runner.AndroidJUnitRunner
Test running failed: Process crashed.
Tests ran to completion.
这里的消息说:Test running failed: Process crashed.
logcat中还有一条相关信息:
RuntimeException: Unable to find instrumentation info for:
ComponentInfo{com.mrahimy.mytestapplication10.test/androidx.test.runner.AndroidJUnitRunner
这只是Android Studio 4.1.3中file -> new project中选择“Fragment + ViewModel”或“No Activity”创建的模板项目
仪器化测试的例子就是这样。我没有做任何改变。 gradle 包装器版本是gradle-6.5-bin.zip。 kotlin 版本是 1.4.32,gradle 工具版本是 4.1.3
我搜索了 stackoverflow,答案要么适用于以前版本的 Android Studio,要么问题来自完全不同的框架。
那么我该怎么做才能查看配置有什么问题呢?
【问题讨论】:
标签: android android-studio testing android-instrumentation