After updating from SonarQube Gradle plugin 4.0.0.2929
→ 4.1.0.3113
our CI build is failing when executing the sonar
task with the following messages:
+ ./gradlew sonar
Encryption of the configuration cache is enabled.
Calculating task graph as no configuration cache is available for tasks: sonar
1 problem was found storing the configuration cache.
- Task `:sonar` of type `org.sonarqube.gradle.SonarTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultMapProperty'
See the complete report at file:///home/jenkins/agent/workspace/oid_app_renovate_sonarqubeplugin/build/reports/configuration-cache/cfswrb5ii8p68ov5cxoo5wm5x/2nknctsxq4b5fvpzo31e15vvv/configuration-cache-report.html
FAILURE: Build failed with an exception.
* What went wrong:
Could not load the value of field `properties` of task `:sonar` of type `org.sonarqube.gradle.SonarTask`.
> Unexpected provider value
* 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 21s
When disabling configuration cache we see another error:
+ ./gradlew sonar -no-configuration-cache
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sonar'.
> class org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension_Decorated cannot be cast to class org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension (org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension_Decorated and org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @4379221a)
* 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 40s
This error did not occur with previous version 4.0.0.2929
.
We are using Gradle 8.1.1 in an Android project (Android gradle plugin 8.0.2).