Closed Bug 1954733 Opened 8 months ago Closed 8 months ago

"Configuration cache state could not be cached" error when running `./mach gradle geckoview:apiLintDebug`

Categories

(Firefox for Android :: Tooling, defect)

All
Android
defect

Tracking

()

RESOLVED DUPLICATE of bug 1950099

People

(Reporter: saschanaz, Unassigned)

References

(Regression)

Details

(Keywords: regression)

> ./mach gradle geckoview:apiLintDebug
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf-8
Configuration on demand is an incubating feature.
Calculating task graph as no cached configuration is available for tasks: geckoview:apiLintDebug
mozconfig.gradle> Loading mach environment into a gradle extension property

> Configure project :dependencies
This version of Gradle expects version '5.2.0' of the `kotlin-dsl` plugin but version '5.1.2' has been applied to project ':dependencies'. Let Gradle control the version of `kotlin-dsl` by removing any explicit `kotlin-dsl` version constraints from your build logic.

> Configure project :config
This version of Gradle expects version '5.2.0' of the `kotlin-dsl` plugin but version '5.1.2' has been applied to project ':config'. Let Gradle control the version of `kotlin-dsl` by removing any explicit `kotlin-dsl` version constraints from your build logic.
settings.gradle> Disabled auto-publication of application-services. Enable it by settings 'autoPublish.application-services.dir' in local.properties
settings.gradle> Disabled auto-publication of Glean. Enable it by settings 'autoPublish.glean.dir' in local.properties

> Configure project :publicsuffixlist
This version of Gradle expects version '5.2.0' of the `kotlin-dsl` plugin but version '5.1.2' has been applied to project ':publicsuffixlist'. Let Gradle control the version of `kotlin-dsl` by removing any explicit `kotlin-dsl` version constraints from your build logic.

> Configure project :apksize
This version of Gradle expects version '5.2.0' of the `kotlin-dsl` plugin but version '5.1.2' has been applied to project ':apksize'. Let Gradle control the version of `kotlin-dsl` by removing any explicit `kotlin-dsl` version constraints from your build logic.

> Configure project :geckoview
GeckoView version = 137.0.20250303155721-SNAPSHOT

14 problems were found storing the configuration cache, 5 of which seem unique.
- Task `:geckoview:apiGenerateDebug` of type `org.mozilla.apilint.ApiCompatLintTask`: cannot serialize object of type 'com.android.build.gradle.internal.tasks.DexMergingTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.13/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:geckoview:apiGenerateDebug` of type `org.mozilla.apilint.ApiCompatLintTask`: cannot serialize object of type 'com.android.build.gradle.tasks.GenerateResValues', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.13/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:geckoview:apiGenerateDebug` of type `org.mozilla.apilint.ApiCompatLintTask`: cannot serialize object of type 'com.android.build.gradle.tasks.MergeResources', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.13/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:geckoview:apiGenerateDebug` of type `org.mozilla.apilint.ApiCompatLintTask`: cannot serialize object of type 'com.android.build.gradle.tasks.ProcessTestManifest', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.13/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:geckoview:apiGenerateDebug` of type `org.mozilla.apilint.ApiCompatLintTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/8.13/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

See the complete report at file:///D:/gecko/obj-x86_64-unknown-linux-android/gradle/build/reports/configuration-cache/13e5y19b9z5642sw80d81a7e3/7fr56zet1kvacjw3bav4ivl1o/configuration-cache-report.html

[Incubating] Problems report is available at: file:///D:/gecko/obj-x86_64-unknown-linux-android/gradle/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Configuration cache state could not be cached: field `singleStorage` of `com.android.build.api.artifact.impl.TypedStorageProvider` bean found in field `directory` of `com.android.build.api.artifact.impl.StorageProviderImpl` bean found in field `storageProvider` of `com.android.build.api.artifact.impl.ArtifactsImpl` bean found in field `artifacts` of `com.android.build.gradle.internal.variant.TestVariantData` bean found in field `variantData` of `com.android.build.gradle.internal.api.TestVariantImpl_Decorated` bean found in field `testVariant` of `com.android.build.gradle.internal.api.LibraryVariantImpl_Decorated` bean found in field `value` of `groovy.lang.Reference` bean found in field `variant` of `org.mozilla.apilint.ApiLintPlugin$_apply_closure1$_closure2$_closure10` bean found in field `closure` of `org.gradle.api.internal.AbstractTask$ClosureTaskAction` bean found in field `actions` of task `:geckoview:apiGenerateDebug` of type `org.mozilla.apilint.ApiCompatLintTask`: error writing value of type 'java.util.LinkedHashMap'
> java.util.ConcurrentModificationException (no error message)

* 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.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 4s
12 actionable tasks: 12 up-to-date
Configuration cache entry discarded with 14 problems.

Feels like it's a regression but couldn't confirm as reverting the last two patches in bug 1924520 causes merge conflict. Please feel free to unmark it if it's wrong.

Actually I just checked out the old tree given it's recent enough, and the same command did not throw any error.

Status: NEW → RESOLVED
Closed: 8 months ago
Duplicate of bug: 1950099
Resolution: --- → DUPLICATE

Will fix this soon, in the meantime, you could run it as ./mach gradle geckoview:apiLintDebug --no-configuration-cache

You need to log in before you can comment on or make changes to this bug.