androidgradleandroid-gradle-pluginrobolectric-gradle-plugin

Cannot add a configuration with name 'testCompile' as a configuration with that name already exists


When updating to gradle plugin 1.1.0 I kept getting the following error

Cannot add a configuration with name 'testCompile' as a configuration with that name already exists

I am also using the Robolectric gradle plugin from here, v0.14.0.

The new gradle 1.1.0 plugin adds additional unit test support, so I suspect the gradle and Robolectric plugins are battling for use of 'testCompile,' though I'm not sure how to resolve this.


Solution

  • Looks like the fine people over at Robolectric have updated their plugin to resolve the issue.

    Use Robolectric Plugin v1.0.0 and you will be able to update gradle plugin and also run your Robolectric tests.

    Here is the discussion on the pull request if you are interested in further information:

    https://github.com/robolectric/robolectric-gradle-plugin/issues/128