SonarCloud not compatible with Gradle 7

I have the same problem.
locally on 3 different computers with three Android Studios everything works, on the server the Build crashes

before upgrading gradle version 4 to 7 everything worked. the same code if I bring it back to 4 works

 
File Build.gradle (module)


apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'

android {

    signingConfigs {
        MyGenapiSign {
            storeFile file('myfile-android.jks')
            storePassword 'xxyx!xxYxr'
            keyPassword 'xxyx!xxYxr1234'
            keyAlias 'MyFile'
        }
    }
    compileSdkVersion 30

    defaultConfig {
        applicationId "fr.my.my"
        minSdkVersion 28
        targetSdkVersion 30
        versionCode 17
        versionName "1.0"


        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.MyGenapiSign
    }

    buildTypes {
        debug {
            debuggable true

            buildConfigField  "String", "BUILD_VARIANT",  "\"debug\""

            resValue "string", "SSO_PROD", SSO_PROD
            resValue "string", "SSO_DEV", SSO_DEV
 

        }

        release {
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.MyGenapiSign

            buildConfigField  "String", "BUILD_VARIANT",  "\"release\""

            resValue "string", "SSO_PROD", SSO_PROD
            resValue "string", "SSO_DEV", SSO_DEV

           
        }
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    ndkVersion '22.0.7026061'

    lintOptions {
        abortOnError false
    }

    }

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
   // implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.10"
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'com.google.firebase:firebase-analytics:19.0.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'

    // Declare the dependencies for the Crashlytics and Analytics libraries
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation platform('com.google.firebase:firebase-bom:26.1.0')
    implementation 'com.google.firebase:firebase-crashlytics-ktx'

    implementation 'com.google.firebase:firebase-analytics-ktx'

    implementation 'androidx.wear:wear:1.1.0'
    implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
    implementation 'com.google.firebase:firebase-crashlytics:18.2.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    implementation 'org.jetbrains.anko:anko-common:0.9'
    //noinspection GradleCompatible
    implementation 'com.android.support:cardview-v7:28.0.0'

    implementation 'androidx.biometric:biometric:1.2.0-alpha03'
    compileOnly 'com.google.android.wearable:wearable:2.8.1'

    implementation 'com.google.android.gms:play-services-basement:17.6.0'

   // implementation platform('com.google.firebase:firebase-bom:25.12.0')

    ///ROOM
    def room_version = "2.3.0"

    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"

    // JWT Decode
    implementation 'com.auth0.android:jwtdecode:2.0.0'

    // Licensing
    implementation 'com.auth0:java-jwt:3.13.0'

    implementation 'com.google.code.gson:gson:2.8.6'

    //Circleimageview
    implementation 'de.hdodenhof:circleimageview:3.0.0'

    //Chrome Custom Tabs
    //noinspection GradleCompatible
    implementation 'com.android.support:customtabs:28.0.0'

    implementation "androidx.browser:browser:1.3.0"
    //noinspection GradleCompatible
    implementation 'com.android.support:support-v4:28.0.0'

    //lifecycle
    implementation "android.arch.lifecycle:extensions:1.1.1"

    // Declare the dependency for the Performance Monitoring library
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-perf-ktx'


}


File Build.gradle (project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.5.20'
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.8'

        // Add the dependency for the Performance Monitoring plugin
        classpath 'com.google.firebase:perf-plugin:1.4.0'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
// Performance Monitoring plugin

    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


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.

      Possible solutions:

      1. Make the getter public.
      2. Annotate the public version of the getter.