"Could not launch activity" 在浓缩咖啡测试中

"Could not launch activity" in espresso test

这是我的 full code,当我使用 "Android Tests" 测试以下代码时,它引发错误 "Could not launch activity"

//TestPlayer.kt
public class PlayerTest : ActivityInstrumentationTestCase2<Player>(Player::class.java) {
    override fun setUp() {
        super.setUp()
        getActivity()
    }

    fun testPlayer() {
        onView(withId(R.id.player)).perform(doubleClick())
    }
}

我在android监视器中没有找到任何输出,如何调试它?

您需要像这样在 AndroidManifest.xml 中声明 Player activity:

<activity
    android:name=".Player"
    android:theme="@style/AppTheme.NoActionBar">
</activity>