Currently we prepare the migration to Gradle 9. Our whole Android project build and pipeline is working so far. But we get the following error when running sonar Gradle task:
[2025-07-03T14:42:18.387Z] > Task :sonar FAILED
[2025-07-03T14:42:18.387Z]
[2025-07-03T14:42:18.387Z] FAILURE: Build failed with an exception.
[2025-07-03T14:42:18.387Z]
[2025-07-03T14:42:18.387Z] * What went wrong:
[2025-07-03T14:42:18.387Z] Execution failed for task ':sonar'.
[2025-07-03T14:42:18.387Z] > Resolution of the configuration ':app:debugCompileClasspath' was attempted without an exclusive lock. This is unsafe and not allowed.
[2025-07-03T14:42:18.387Z]
[2025-07-03T14:42:18.387Z] * Try:
[2025-07-03T14:42:18.387Z] > For more information, please refer to https://docs.gradle.org/9.0.0-rc-1/userguide/viewing_debugging_dependencies.html.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.
[2025-07-03T14:42:18.387Z] > Run with --stacktrace option to get the stack trace.
[2025-07-03T14:42:18.387Z] > Run with --info or --debug option to get more log output.
[2025-07-03T14:42:18.387Z] > Run with --scan to generate a Build Scan (Powered by Develocity).
[2025-07-03T14:42:18.387Z] > Get more help at https://help.gradle.org.
[2025-07-03T14:42:18.387Z]
[2025-07-03T14:42:18.387Z] BUILD FAILED in 5s
We are using sonar plugin version 6.2.0.5505.
With Gradle 8.14.2 everthing is working.
Would be nice if you could verify that and make sure we are not blocked when Gradle 9 hits final.
thanks for your reply. We have a dedicated step in our pipeline which simply executes:
sh “./gradlew sonar”
In general we use Sonarqube in an mixed Android and Kotlin-only multimodule project. There is no special configuration or logic involved.
The tasks succeeds with latest stable Gradle 8.14.3.
I can try to provide a reproducable project. But I thought you might have some test projects where you can check Gradle 9.0.0-rc-1 aswell and see if you run into the same issue.
Still the sonar tasks only succeeds when adding “–no-parallel”. New error message without this is:
> Task :sonar FAILED
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'