Type Android Junit4 not present exception

后端 未结 6 523
陌清茗
陌清茗 2021-01-01 08:41

I have an Android project that I am trying to run Instrumentation tests for using AndroidStudio, but when I try to run the whole class file for the tests, I get the exceptio

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-01 09:21

    This is caused by Android Studio trying to execute an instrumentation test as a JUnit test.

    I had to go to 'Edit Configurations...' and delete the configuration from Android JUnit group and manually add to the 'Android Instrumented Tests' group. After this I had no problem executing the tests.

    In Android Studio, click Run > Edit Configurations.

    https://developer.android.com/studio/run/rundebugconfig

提交回复
热议问题