Gradle sync failed: Plugin [id: 'com.android.application', version: '7.1.1', apply: false] was not found in any of the following sources:

在src里面的build.gradle中
plugins {
id ‘com.android.application’
}
的上面加上
 buildscript {repositories {jcenter()}dependencies {classpath 'com.android.tools.build:gradle:7.1.2'}
}
plugins {id 'com.android.application'