Test running failed: Unable to find instrumentation info for: ComponentInfo{} -- error trying to test in IntelliJ with Gradle
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
)
I am using Android Studio 1.1 and the following steps solved this issue for me:
In
Run - Edit Configurations - Android Tests
Specify instrumentation runner asandroid.test.InstrumentationTestRunner
Then in the "Build variants" tool window (on the left), change the test artifact to
Android Instrumentation Tests
.
No testInstrumentationRunner required in build.gradle and no instrumentation tag required in manifest file.