When launching my test suite from the command line:
./gradlew "connectedDebugAndroidTest"
there is a task that is taking more than 4 minutes, even if no changes have been made:
> :app:processDebugAndroidTestManifest > Resolve dependencies of :app:debugAndroidTestRuntimeClasspath > espresso-core-$project.espressoVersion.pom
It only takes 20 seconds to run the entire test suite, and maybe 10 seconds to compile. During this 4-minute task, there is only one java
process on the machine, and it is consuming less than 0.01%
cpu (according to top
).
Is this task necessary? It doesn't appear to be doing anything. Is there a way to simply remove it from the build, or skip it?
Gradle wants to check on the status of dependencies on each build by default. Your specific line is for Espresso, which (presumably) you are using in your tests.
Since you are using ./gradlew
, you could try adding --offline
to your command to tell Gradle to always work purely from cache. If you add dependencies or change dependency versions, though, you will need to run at least once without that switch.
You could also try playing with Gradle timeout settings, though usually that's a solution for increasing the timeout rather than decreasing it.