question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load compiled classes for initialization script

See original GitHub issue

We often see the following failure when executing jobs with a gradle-build-action in various workflows. What they all have in common when the error occurs is that the id build_scan_capture_init_6jxid5m3sbemobrv5hpcfrrqr is printed. Is there any advice to work around or fix this problem? Could it be a broken cache entry?

Run gradle/gradle-build-action@v2
Restore Gradle state from cache
Writing init script: /home/runner/work/_temp/build-scan-capture.init.gradle
/home/runner/work/project1/project1/gradlew some-task --no-daemon --init-script /home/runner/work/_temp/build-scan-capture.init.gradle
Downloading https://services.gradle.org/distributions/gradle-7.2-all.zip
..............10%...............20%...............30%...............40%...............50%...............60%...............70%...............80%...............90%...............100%
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 

FAILURE: Build failed with an exception.

* What went wrong:
Could not load compiled classes for initialization script '/home/runner/work/_temp/build-scan-capture.init.gradle' from cache.
> build_scan_capture_init_6jxid5m3sbemobrv5hpcfrrqr

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
bigdazcommented, Oct 14, 2021

@wolfs In the Gradle build, it looks like happens when the instrumented jars (~/.gradle/caches/jars-9/*/*.jar) are not being restored into Gradle User Home. This could easily happen if the cache entry is evicted due to the 5Gb cache limit.

I had assumed that Gradle would simply regenerate these jars if they are not present, but I guess I need to investigate further.

https://github.com/gradle/gradle/runs/3899330504?check_suite_focus=true#step:4:67

2reactions
bigdazcommented, Oct 16, 2021

This issue has been fixed in v2.0-beta.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load compiled classes for initialization script from ...
I have a multimodule Gradle project. There is a buildSrc folder inside this top-level project and it contains several Groovy Files with ...
Read more >
Flutter : Could not load compiled classes for build file ...
A problem occurred configuring root project 'android'. > Could not load compiled classes for build file 'D:\FLUTTER\task_manager\android\build.
Read more >
GradleException: Could not load compiled classes for build ...
Could not load compiled classes for build file 'C:\temp\gradle\test\build.gradle' from cache. * Try: Run with --stacktrace option to get the stack trace.
Read more >
[Solved]-Could not load compiled classes for settings file-Flutter
Try to clear gradle cache. The <home directory>/.gradle/caches directory holds the Gradle build cache you can delete it.
Read more >
Android build error. Problem with gradle.settings
GradleException : Could not load compiled classes for settings file '/bitrise/src/settings.gradle' from cache. Two different build with fails ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found