Could not determine the dependencies of task ':sonarqube'

Hi,

I am new to gradle and I getting the below error during the time of running sonarqube code analysis for gradle project.
Could not determine the dependencies of task ':sonarqube'

My root directory build.gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.0'
        classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

plugins {
  id "org.sonarqube" version "2.7"
}

apply plugin: "org.sonarqube"

allprojects {
    repositories {
        google()
        jcenter()

    }
}

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

ext {
    roomVersion = '2.2.1'
}

Logs:

All projects evaluated.
Analytics other plugin to proto: Unknown plugin type org.sonarqube.gradle.SonarQubePlugin expected enum ORG_SONARQUBE_GRADLE_SONARQUBEPLUGIN
Selected primary task 'sonarqube' from project :

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':sonarqube'.
> java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s

Help me resolve the issue.

Regards,
GuGu