Gradle 同步失败:插件 [id: 'com.android.application',版本:'7.1.2',应用:false] 在以下任何来源中均未找到:

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

我已经升级了我的 Android Studio,之后我遇到了这个错误:

Gradle sync failed: Plugin [id: 'com.android.application', version: '7.1.2', apply: false] 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.android.application:com.android.application.gradle.plugin:7.1.2')
                Searched in the following repositories:
                Gradle Central Plugin Repository
                Google
                MavenRepo (24 s 586 ms)

我已将 JDK 升级到 11,但没有修复错误。我还能做什么?

已解决:

在尝试了一些其他解决方案后,我发现我没有删除 gradle-wrapper.properties 中的代理。那阻止了我的项目下载依赖项。

转到 tp 设置 -> 然后插件 -> 在插件中 -> 然后单击三个点 -> 然后启用所有下载的插件

试试这个肯定有用。 enter image description here

我今天有意更新到gradle7.1.3时遇到了同样的问题,我只是重新启动android工作室并将gradle版本更改为7.1.2并且它成功了。