Gradle Sonar Scanner can't find gradle starting with sonarqube gradle plugin 4.3.1

We are using a Gradle 8.3 docker container to run our sonar scans. We just upgraded from the sonarqube-gradle-plugin version 3.1.1 to 4.2.1.3168. We were trying to upgrade to sonarqube-gradle-plugin version 4.4.1.3373 but got an issue running the gradle sonar command where it was unable to find our gradle installation. This happens for every version after 4.2.1.3168 for us. This causes our container to use gradle wrapper to try and download the “missing” gradle 8.3 installation but we run our tests specifically in an environment with no outside internet access which has not been an issue until now.

Logs:

[2024-04-09T21:23:28.314Z] > Task :src:mobile-android:sonarqube
[2024-04-09T21:23:28.314Z] Task 'sonarqube' is deprecated. Use 'sonar' instead.
[2024-04-09T21:23:36.438Z] The property 'sonar.login' is deprecated and will be removed in the future. Please use the 'sonar.token' property instead when passing a token.
[2024-04-09T21:23:38.346Z] File '/home/<redacted path>.kt' is ignored. It is not located in module basedir '/home/<redacted path>/libs'.
[2024-04-09T21:23:46.477Z] 
[2024-04-09T21:23:46.477Z] Downloading https://services.gradle.org/distributions/gradle-8.3-bin.zip
[2024-04-09T21:23:46.477Z] 
[2024-04-09T21:23:46.477Z] 
[2024-04-09T21:23:46.477Z] > Task :src:mobile-android:sonarqube FAILED
[2024-04-09T21:23:46.477Z] 
[2024-04-09T21:23:46.477Z] FAILURE: Build failed with an exception.
[2024-04-09T21:23:46.477Z] 
[2024-04-09T21:23:46.477Z] * What went wrong:
[2024-04-09T21:23:46.477Z] Execution failed for task ':src:mobile-android:sonarqube'.
[2024-04-09T21:23:46.477Z] > Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-8.3-bin.zip'.

hey there.

Why this version and not the latest version, 5.0.0.4638?

What version of SonarQube are you targeting?

We tried 5.0.0.4638 but also go the same error. We are currently using version 4.2.1.3168 but we would like to be using either of the two latest versions, 4.4.1.3373 or 5.0.0.4638. Our SonarQube server version is 10.3.

Thanks! A fix for this specific issue was delivered in v10.4, and the latest version is v10.5. An upgrade should set it all straight, and you can use the latest version of the Scanner for Gradle.