realm-java
realm-java copied to clipboard
Incompatibility issue with Gradle configuration cache
The configuration cache is a feature that significantly improves build performance by caching the result of the configuration phase and reusing this for subsequent builds.
Implementing support for the configuration cache in this plugin would improve users experience by dramatically reducing build times.
See https://docs.gradle.org/current/userguide/configuration_cache.html
The configuration cache is already available since Gradle 6.6.
When I run ./gradlew app:assembleRelease
, and the configuration doesn't come from the cache, Gradle reports this error:
Task `:app:transformClassesWithRealmTransformerForDebug` of type
`com.android.build.gradle.internal.pipeline.TransformTask`: 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/6.8.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
Are there any plans to support configuration cache?
Thanks for the heads up on configuration cache, we are going to evaluate supporting it.
In Android Studio 7.0.0 there is a warning in the Build Analyzer, that configuration cache could be enabled. Unfortunately Realm is not yet compatible.
Looking a bit into this. It requires us to move to Gradle 7.0 as well, which contains a few breaking changes for us. I'm currently looking into how difficult it would be to upgrade.
Hmm, this also requires Java 11 it seems, so also ties into #7533
We will address this as part of https://github.com/realm/realm-java/pull/7535
@Jeff11 @sanogueralorenzo I'm trying to reproduce this, but cannot. Can you try to describe the exact versions of Gradle, Android Studio and Android Gradle plugin you are using?
I have also the same issue, that the configuration cache is not working. My used versions are:
- Android Studio Arctic Fox | 2020.3.1 Patch 1 Build #AI-203.7717.56.2031.7621141, built on August 7, 2021
- Gradle JDK: Android Studio Default JDK 11.0.10
- Android Gradle Plugin Version 7.0.1
- Gradle Verson 7.1
- io.realm:realm-gradle-plugin:10.8.0
I believe its not yet merged with 10.10.1, when can we expect it to be available in stable release?
The configuration cache is still not working. My used versions are:
- Android Studio Electric Eel | 2022.1.1 Beta 1
- Gradle JDK: Android Studio Default JDK 11.
- Android Gradle Plugin Version 7.2.2
- Gradle Version 7.3.3
- io.realm:realm-gradle-plugin:10.10.1
@cmelchior
The latest realm gradle plugin 10.11.1 is shown as incompatible with Gradle Configuraton cache feature. Using Android Studio Flamingo 2022.2.1 Canary 6
Can I have some eyes on this PR please: https://github.com/realm/realm-java/pull/7750 It adds support for Configuration Cache for -transformer-api
versions. @cmelchior
Still get the warning for the 10.13.2-transformer-api
version
Is there any update on this, on 10.5.1 and the configuration cache seems to be incompatible.
I am seeing the same issue. This is what is reported when building the application
realm-android: not compatible You could save about 2.2s by turning Configuration cache on. With Configuration cache, Gradle can skip the configuration phase entirely when nothing that affects the build configuration has changed. The version of this plugin used in this build is not compatible with Configuration cache and we don’t know the version when it becomes compatible. Plugin version: 10.18.0 Plugin dependency: io.realm:realm-gradle-plugin
My environment is defined as: Android Studio Iguana | 2023.2.1 Patch 2 Gradle JDK: Azul Zulu v21.0.3 Android Gradle Plugin Version 8.3..2 Gradle Version 8.7 io.realm:realm-gradle-plugin:10.18.0
Note that the sample is reported if changing Gradle JDK: to Azul Zulu v17.0.9