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

Support Gradle's configuration cache #265

Closed
Goooler opened this issue Mar 18, 2022 · 4 comments
Closed

Support Gradle's configuration cache #265

Goooler opened this issue Mar 18, 2022 · 4 comments
Assignees

Comments

@Goooler
Copy link
Contributor

Goooler commented Mar 18, 2022

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.

@mannodermaus
Copy link
Owner

Thanks for this request and the repro project! I've been wanting to support the configuration cache for a while but hadn't gotten around to it.

@mannodermaus
Copy link
Owner

This was merged into the upstream branch and will be available from version 1.8.2.1 of the plugin. Use its SNAPSHOT if you need it now!

@Goooler
Copy link
Contributor Author

Goooler commented Apr 9, 2022

It works, thanks!

@mannodermaus
Copy link
Owner

Released in 1.8.2.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants