Why is the Android test runner reporting “Empty test suite”?

前端 未结 30 2235
有刺的猬
有刺的猬 2020-11-28 07:59

I am banging my head against the wall here trying to figure out why IntelliJ/Android is reporting \"Empty test suite\". I have a small project with two IntelliJ Modules (\"

30条回答
  •  悲哀的现实
    2020-11-28 08:31

    I experienced the "Empty test suite" error when trying to run local unit tests in my Android Studio 3.0 project.

    After reading the Android Developer documentation, I quickly realised that the issue was caused by my gradle config which included the following lines.

    testImplementation 'com.android.support.test:runner:0.5'
    testImplementation 'com.android.support.test:rules:0.5'
    

    The AndroidJUnitRunner class is a JUnit test runner that lets you run JUnit 3- or JUnit 4-style test classes on Android devices.

    Since my tests were local and therefore not required to run on any device, removing the above com.android.support.test... entries enabled me to execute the unit tests.

提交回复
热议问题