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

后端 未结 10 1877
野的像风
野的像风 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:28

    I had the same error when I tried adding multiDexEnabled true to build.gradle.

    I'm adding my experience here, because this is one of the first Google hits when searching with the ... Unable to find ... ComponentInfo ... error message.

    In my case adding testInstrumentationRunner like here did the trick:

    ...
    android {
        ...
        defaultConfig {
            ...
            testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
        }
    }
    

    (I have com.android.tools.build:gradle:1.5.0)

提交回复
热议问题