Could not determine the dependencies of task ‘:sonar’.
Could not create task ‘:app:sonarResolver’.
Extension of type ‘AppExtension’ does not exist. Currently registered extension types: [ExtraPropertiesExtension, SonarExtension, SonarExtension, VersionCatalogsExtension, BasePluginExtension, SourceSetContainer, ReportingExtension, JavaToolchainService, JavaPluginExtension, KotlinAndroidProjectExtension, ApplicationExtension, ApplicationAndroidComponentsExtension, LintLifecycleExtension, GoogleServicesPlugin.GoogleServicesPluginConfig, KspExtension]
id("org.sonarqube") version "7.2.2.6593"
id("com.android.application") version "9.0.0" apply false
id("com.android.library") version "9.0.0" apply false
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
Android Studio Otter 3 Feature Drop | 2025.2.3
Build #AI-252.28238.7.2523.14688667, built on January 9, 2026
Runtime version: 21.0.8±14196175-b1038.72 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 3072M
Cores: 20
Registry:
ide.experimental.ui=true
See:
From the source code (sonar)
This bug happens local and also in our ci:
Now when I use following inside my gradle.properties:
android.newDsl=false
and change in my build.gradle.kts
android {
to
import com.android.build.api.dsl.ApplicationExtension
extensions.configure<ApplicationExtension>("android") {
The sonar plugin works again.
Here is the ouput after the working version:
$ gradle sonar
> Configure project :app
WARNING: The option setting ‘android.newDsl=false’ is deprecated.
The current default is ‘true’.
It will be removed in version 10.0 of the Android Gradle plugin.
> Task :sonarResolver
> Task :app:sonarResolver
Invocation of Task.project at execution time has been deprecated. This will fail with an error in Gradle 10. This API is incompatible with the configuration cache, which will become the only mode supported by Gradle in a future release. Consult the upgrading guide for further information: https://docs.gradle.org/9.1.0/userguide/upgrading_version_7.html#task_project


