Test running failed: Unable to find instrumentation info for: ComponentInfo{} — error trying to test in IntelliJ with Gradle

后端 未结 10 1875
野的像风
野的像风 2021-02-01 01:14

Everytime I try to run my tests the console says this:

Running tests
Test running startedTest running failed: Unable to find instrumentation info for:
ComponentI         


        
10条回答
  •  滥情空心
    2021-02-01 01:37

    I had this problem and fixed it by going to Run -> Edit Configurations -> Green '+' button at the top left -> JUnit

    From there, set the 'use the classpath mod...' to 'app' (or your default app name, which is the one that appears to the left of the run (play button) when you run the app)

    Finally, put your test class name in the 'class:' textbox. Click apply and okay.

    At this point, if the test class doesn't have other errors, it should work.

提交回复
热议问题