I have been struggling with unit-test-android problem for quite a long time. I have seen this, this and that, finally I found the gradle-android-test-plugin and even got it working. I can now run the tests with gradlew test
command.
But, writing those tests in IDE (Android Studio or IntelliJ 13) is far from comfortable, because it does not see the junit & Robolectric dependencies added with testCompile
dependency.
Is there any way to add these dependencies to the IDE classpath but still avoid to package them in the production app (thus, AFAIU compile
dependency cannot be used)?