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.
- 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
- 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
- Pull Cache Task
- Gradle Runner Task with caching set to “all”
- Gradle Push Task default parameters
- 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?