Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached builds failing with Gradle 6.5 #75

Closed
G00fY2 opened this issue Jun 8, 2020 · 3 comments
Closed

Cached builds failing with Gradle 6.5 #75

G00fY2 opened this issue Jun 8, 2020 · 3 comments

Comments

@G00fY2
Copy link

G00fY2 commented Jun 8, 2020

Since this topic got no attention in the slack channel or on discuss.bitrise.io I want to report this over here:

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 Dependency file generation fix (#44) #45 to behave exactly the same)

Any idea what the issue could be?

@G00fY2
Copy link
Author

G00fY2 commented Jun 9, 2020

FYI I also created an issue in the Gradle repo: gradle/gradle#13367

@karapigeon
Copy link

Hi @G00fY2,

Thank you for reaching out.

It seems you resolved the problem in the Gradle issue?

@G00fY2
Copy link
Author

G00fY2 commented Jun 15, 2020

Looks like this issue was caused by the bitrise cache-push step, which ignored empty cache directories. This was fixed with the cache-push version 2.3 and will be addressed by the Gradle team with Gradle 6.6.

@G00fY2 G00fY2 closed this as completed Jun 15, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants