3

I have android multi-project test dependency. For Android Plugin for Gradle 2.2.x the solution was the second answer in Multi-project test dependencies with gradle. After updating the plugin to to 2.3.+ it stopped working. The test aar is still generated but it seems like the dependency stopped working:

dependencies {
  compile project(':ProjectA')
  testCompile project(path: ':ProjectA', configuration: 'testArtifacts')
}

Does anyone know how to solve it for gradle plugin 2.3.+ ?

1 Answers1

-1

The problem was with aar's. The jar library works fine with 2.3.+ gradle plugin. I was not unable to solve it. For plugin 3.0.+ it started working again but was not stable due to lint failures (sometimes it doesn't sometimes it does fails).

The most robust solution was to create new android library module and move all test classes to its src/main/java folder (not to test variant). That way it will create normal aar with classes needed to be used in other modules and can be added as a normal dependency like:

testCompile project(path: ':test_cmn')

The answer to it was found here: How Do We Inherit Test Classes Across Android Library Modules?