Skip to content

Support Gradle's configuration cache #265

@Goooler

Description

@Goooler

https://docs.gradle.org/7.4/userguide/configuration_cache.html

FAILURE: Build failed with an exception.

* What went wrong:
Configuration cache state could not be cached: field 'variant' from type 'de.mannodermaus.gradle.plugins.junit5.tasks.AndroidJUnit5WriteFilters': error writing value of type 'com.android.build.gradle.internal.api.TestVariantImpl'
> Configuration cache state could not be cached: field 'testedVariantData' from type 'com.android.build.gradle.internal.api.TestVariantImpl': error writing value of type 'com.android.build.gradle.internal.api.LibraryVariantImpl'
> Configuration cache state could not be cached: field 'unitTestVariant' from type 'com.android.build.gradle.internal.api.LibraryVariantImpl': error writing value of type 'com.android.build.gradle.internal.api.UnitTestVariantImpl'
> Configuration cache state could not be cached: field 'variantData' from type 'com.android.build.gradle.internal.api.UnitTestVariantImpl': error writing value of type 'com.android.build.gradle.internal.variant.TestVariantData'
> Configuration cache state could not be cached: field 'testedVariantData' from type 'com.android.build.gradle.internal.variant.TestVariantData': error writing value of type 'com.android.build.gradle.internal.variant.LibraryVariantData'
> Configuration cache state could not be cached: field 'globalScope' from type 'com.android.build.gradle.internal.variant.LibraryVariantData': error writing value of type 'com.android.build.gradle.internal.scope.GlobalScope'
> Configuration cache state could not be cached: field 'extension' from type 'com.android.build.gradle.internal.scope.GlobalScope': error writing value of type 'com.android.build.gradle.LibraryExtension'
> Configuration cache state could not be cached: field 'libraryVariantList' from type 'com.android.build.gradle.LibraryExtension': error writing value of type 'org.gradle.api.internal.DefaultDomainObjectSet'
> Configuration cache state could not be cached: field 'eventRegister' from type 'org.gradle.api.internal.DefaultDomainObjectSet': error writing value of type 'org.gradle.api.internal.collections.DefaultCollectionEventRegister'
> Configuration cache state could not be cached: field 'addActions' from type 'org.gradle.api.internal.collections.DefaultCollectionEventRegister': error writing value of type 'org.gradle.internal.ImmutableActionSet$SetWithManyActions'
> Configuration cache state could not be cached: field 'multipleActions' from type 'org.gradle.internal.ImmutableActionSet$SetWithManyActions': error writing value of type 'com.google.common.collect.RegularImmutableSet'
> Configuration cache state could not be cached: field 'delegate' from type 'org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction': error writing value of type 'org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1'
> Configuration cache state could not be cached: field 'val$action' from type 'org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1': error writing value of type 'org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt$sam$org_gradle_api_Action$0'
> Configuration cache state could not be cached: field 'function' from type 'org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt$sam$org_gradle_api_Action$0': error writing value of type 'org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$configureTarget$2'
> Configuration cache state could not be cached: field '$kotlinAndroidTarget' from type 'org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$configureTarget$2': error writing value of type 'org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget'
> Configuration cache state could not be cached: field 'compilations' from type 'org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget': error writing value of type 'org.gradle.api.internal.FactoryNamedDomainObjectContainer'
> Configuration cache state could not be cached: field 'index' from type 'org.gradle.api.internal.FactoryNamedDomainObjectContainer': error writing value of type 'org.gradle.api.internal.DefaultNamedDomainObjectCollection$UnfilteredIndex'
> Configuration cache state could not be cached: field 'map' from type 'org.gradle.api.internal.DefaultNamedDomainObjectCollection$UnfilteredIndex': error writing value of type 'java.util.TreeMap'
> Configuration cache state could not be cached: field 'androidVariant' from type 'org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation': error writing value of type 'com.android.build.gradle.internal.api.LibraryVariantImpl'
> Configuration cache state could not be cached: field 'unitTestVariant' from type 'com.android.build.gradle.internal.api.LibraryVariantImpl': error writing value of type 'com.android.build.gradle.internal.api.UnitTestVariantImpl'
> Configuration cache state could not be cached: field 'variantData' from type 'com.android.build.gradle.internal.api.UnitTestVariantImpl': error writing value of type 'com.android.build.gradle.internal.variant.TestVariantData'
> Configuration cache state could not be cached: field 'testedVariantData' from type 'com.android.build.gradle.internal.variant.TestVariantData': error writing value of type 'com.android.build.gradle.internal.variant.LibraryVariantData'
> Configuration cache state could not be cached: field 'paths' from type 'com.android.build.gradle.internal.variant.LibraryVariantData': error writing value of type 'com.android.build.gradle.internal.variant.VariantPathHelper'
> Configuration cache state could not be cached: field 'variantDslInfo' from type 'com.android.build.gradle.internal.variant.VariantPathHelper': error writing value of type 'com.android.build.gradle.internal.core.VariantDslInfoImpl'
> Configuration cache state could not be cached: field 'dataProvider' from type 'com.android.build.gradle.internal.core.VariantDslInfoImpl': error writing value of type 'com.android.build.gradle.internal.manifest.LazyManifestParser'
> Configuration cache state could not be cached: field 'manifestParsingAllowed' from type 'com.android.build.gradle.internal.manifest.LazyManifestParser': error writing value of type 'com.android.build.gradle.internal.VariantManager$createVariant$variantDslInfoBuilder$1'
> Configuration cache state could not be cached: field 'this$0' from type 'com.android.build.gradle.internal.VariantManager$createVariant$variantDslInfoBuilder$1': error writing value of type 'com.android.build.gradle.internal.VariantManager'
> Configuration cache state could not be cached: field 'nestedComponents' from type 'com.android.build.gradle.internal.VariantManager': error writing value of type 'java.util.ArrayList'
> Configuration cache state could not be cached: field 'delegate$delegate' from type 'com.android.build.api.component.impl.AndroidTestImpl': error writing value of type 'kotlin.SynchronizedLazyImpl'
> Configuration cache state could not be cached: field 'value' from type 'kotlin.InitializedLazyImpl': error writing value of type 'com.android.build.api.component.impl.AndroidTestCreationConfigImpl'
> Configuration cache state could not be cached: field 'variantDslInfo' from type 'com.android.build.api.component.impl.AndroidTestCreationConfigImpl': error writing value of type 'com.android.build.gradle.internal.core.VariantDslInfoImpl'
> Configuration cache state could not be cached: field 'productionVariant' from type 'com.android.build.gradle.internal.core.VariantDslInfoImpl': error writing value of type 'com.android.build.gradle.internal.core.VariantDslInfoImpl'
> Configuration cache state could not be cached: field 'namespaceForR$delegate' from type 'com.android.build.gradle.internal.core.VariantDslInfoImpl': error writing value of type 'kotlin.SynchronizedLazyImpl'
> namespaceForR should only be used by test variants

Can reproduce this issue in Goooler/DemoApp#60.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions