Cached builds failing with Gradle 6.5

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?

7 Likes

We are also experiencing this.

1 Like

Same here. Bitrise, please help!!

Temporarily, I removed cache steps until this is solved.

Same here, reverting to Gradle 6.4.1 fixes the issue.

Same here!

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

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

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.