slackhq / foundry

Gradle and IntelliJ build tooling used in Slack's Android repo
https://slackhq.github.io/foundry/
Apache License 2.0
432 stars 21 forks source link

Configuration caching is broken by UpdateRobolectricJarsTask #501

Closed bryanstern closed 7 months ago

bryanstern commented 1 year ago

Tried re-enabling Gradle configuration caching in my project once we were updated to Kotlin 1.9.0 since it didn't seem to work with Multiplatform projects. Now it doesn't seem to be playing nice with the update robolectric jars task. Using SGP 0.10.0.

FAILURE: Build failed with an exception.

* What went wrong:
Configuration cache state could not be cached: field `__allJars__` of task `:updateRobolectricJars` of type `slack.gradle.tasks.robolectric.UpdateRobolectricJarsTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultListProperty'
> Could not resolve all artifacts for configuration ':detachedConfiguration1'.
   > Could not find org.robolectric:android-all-instrumented:11-robolectric-6757853-i-1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/robolectric/android-all-instrumented/11-robolectric-6757853-i-1/android-all-instrumented-11-robolectric-6757853-i-1.pom
       - https://maven-central.storage-download.googleapis.com/maven2/org/robolectric/android-all-instrumented/11-robolectric-6757853-i-1/android-all-instrumented-11-robolectric-6757853-i-1.pom
       - https://repo.maven.apache.org/maven2/org/robolectric/android-all-instrumented/11-robolectric-6757853-i-1/android-all-instrumented-11-robolectric-6757853-i-1.pom
       - https://jitpack.io/org/robolectric/android-all-instrumented/11-robolectric-6757853-i-1/android-all-instrumented-11-robolectric-6757853-i-1.pom
     Required by:
         project :

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org./

BUILD FAILED in 7s
Error: Gradle build failed: see console output for details
ZacSweers commented 1 year ago

I think this is a red herring from gradle, where the real issue is that the underlying task failed for an unrelated issue and gradle tried to unsuccessfully serialize the exception (it's got a history of this, it's annoying). Were you running the updateRobolectricJars task when it happened?

bryanstern commented 1 year ago

Running into it when running roborazzi (e.g. app:verifyRoborazziInternalDebug).

takahirom commented 1 year ago

It seems a bit difficult to understand the issue just by looking at the error. Please provide a reproducible project, or let me know if there's anything else I can do to help.

bryanstern commented 1 year ago

No worries, pretty sure this isn't a roborazzi bug.

bryanstern commented 7 months ago

Cannot reproduce anymore 🤷