FAILURE: Build failed with an exception2

Dear Concern, I am facing “FAILURE: Build failed with an exception.” while building project and task with dependencies. i only change targetSdkVersion 29 to targetSdkVersion 31
The details message with error is given below:

FAILURE: Build failed with an exception.

  • Where:
    Auto-applied by using --scan

  • What went wrong:
    Plugin [id: ‘com.gradle.build-scan’, version: ‘2.4.2’, artifact: ‘com.gradle:build-scan-plugin:2.4.2’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Plugin Repositories (could not resolve plugin artifact ‘com.gradle:build-scan-plugin:2.4.2’)
    Searched in the following repositories:
    Gradle Central Plugin Repository
  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.plugins.UnknownPluginException: Plugin [id: ‘com.gradle.build-scan’, version: ‘2.4.2’, artifact: ‘com.gradle:build-scan-plugin:2.4.2’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Plugin Repositories (could not resolve plugin artifact ‘com.gradle:build-scan-plugin:2.4.2’)
    Searched in the following repositories:
    Gradle Central Plugin Repository
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:268)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$100(DefaultPluginRequestApplicator.java:63)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:93)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:89)
    at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:207)
    at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:201)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:89)