I am trying to upgrade to Gradle 7 and am experiencing the following error with SonarCloud:
Task :sonarqube FAILED WARNING:API ‘variant.getJavaCompile()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see https://d..com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -P.debug.obsoleteApi=true on the command line to display more information.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See Command-Line Interface
451 actionable tasks: 451 executed
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ‘:sonarqube’ (type ‘SonarQubeTask’).
Type ‘org.sonarqube.gradle.SonarQubeTask’ property ‘pluginVersion’ is private and annotated with @Internal.
Reason: Annotations on private getters are ignored.
This looks to be something that isn’t supported yet in SonarCloud, can someone please help me with a workaround or an ETA on when the next patch will be released for this bug?
Task :sonarqube FAILED
WARNING:API ‘variant.getJavaCompile()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see Task Configuration Avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ‘:sonarqube’ (type ‘SonarQubeTask’).
Type ‘org.sonarqube.gradle.SonarQubeTask’ property ‘pluginVersion’ is private and annotated with @Internal.
Reason: Annotations on private getters are ignored.
Thanks for your message. I don’t see any reference to the sonarqube plugin in your build configuration. Could you please provide some more information like full log of the analysis and the right build configuration.
And what do you mean by locally is ok and on server build crashes? Is it your CI? Maybe it will be nice to share your CI configuration too, so I can have a look and probably help.
According to the logs provided I can make a conclusion that you’re using sonarqube plugin of version <2.7 where there is an @Internal annotation on a private getter which is incompatible with the Gradle 7. This was already fixed here.
Please, make sure you’re using the latest version of sonarqube gradle plugin (3.3). The issue should disappear.
If you still can reproduce the issue, please open another thread a provide a proper reproducer, detailed logs and configuration.