Cached builds failing with Gradle 6.5

#1

We recently updated to latest Gradle version 6.5 in most of our Android projects. Unfortunately the builds on bitrise started crashing. There seems to be an issue with the Gradle caching.

A problem occurred configuring project ':app'.
> Expected a single classpath entry, found: []
...
Caused by: java.lang.IllegalStateException: Expected a single classpath entry, found: []
    at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.remapClasses(FileCacheBackedScriptClassCompiler.java:153)

This only occurs on bitrise.io. We have no issues building locally. Also projects on Travis CI (with the same logic) are running fine. Downgrading to Gradle 6.4.1 fixes the issue.

Here is sample project:

I tried several scenarios (some as close as possible as our Travis CI setups) but all are failing. Each time when I changed the workflow I cleared the cache, so the first build after that runs fine.

  1. (build #43)
  • Pull Cache Task
  • Gradle Runner Task with caching set to “none”
  • Gradle Push Task to upload the Gradle cache folder, ignoring recommended files from cache
  1. (build #45)
  • Pull Cache Task
  • Gradle Runner Task with caching set to “none”
  • Bash script to delete recommended files from cache
  • Gradle Push Task to upload the Gradle cache folder
  1. (build #47)
  • Pull Cache Task
  • Gradle Runner Task with caching set to “all”
  • Gradle Push Task default parameters
  1. Travis CI build for the same project running fine using the cache (expected build #45 to behave exactly the same)

Any idea what the issue could be?

17 Likes

#2

We are also experiencing this.

2 Likes

#3

Same here. Bitrise, please help!!

Temporarily, I removed cache steps until this is solved.

0 Likes

#4

Same here, reverting to Gradle 6.4.1 fixes the issue.

0 Likes

#5

Same here!

0 Likes

#6

The same problem happened here. I disabled the pull cache step to fix the problem for now.

0 Likes

#7

I also created a Gradle issue for that: https://github.com/gradle/gradle/issues/13367

As you can see in the ticket this is fixed with Gradle 6.5.1 or updating to the Bitrise cache-push step version 2.3.0

2 Likes