Android Studio错误“支持的最低Gradle版本为7.0.2,当前版本为6.8,”

zte4gxcn  于 2022-12-13  发布在  Android
关注(0)|答案(4)|浏览(1702)

An error occurred after I downloaded version 6.8 and the latest version of Gradle.
A problem occurred evaluating project ':launcher'.
< Failed to apply plugin 'com.android.internal.version-check'.
<< Minimum supported Gradle version is 7.0.2. Current version is 6.8. If using the gradle wrapper, try editing the distributionUrl...
What do I have to do?
I'm attaching more details in the added pictures.

hzbexzde

hzbexzde1#

The error:
Minimum supported Gradle version is 7.0.2. Current version is 6.8.
Likely means:

  • Your "\gradle"-folder is missing from your project folder:
  • (Note: Not to be mistaken for the ".gradle"-folder which is a different folder)*
    Solution:
    Get a copy of the "\gradle"-folder from another working project (or create a new project).

Or:

  • Your "\gradle\wrapper\gradle-wrapper.properties" has an incorrect value in the "distributionUrl=":
    Solution:
    Change the value in "\gradle\wrapper\gradle-wrapper.properties" to

distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
I hade the same problem after moving my project to another computer:
Minimum supported Gradle version is 7.0.2. Current version is 6.8.
Please fix the project's Gradle settings.
Gradle Settings.
Clicking on the "Gradle Settings"-link opened the Gradle settings Window, but the Gradle JDK was already correctly set to version 11 :

So my next step was to check the Project Structure:

And update the Gradle Version to 7.0.2 :

But that led to this error instead:

¤ What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
» Failed to apply plugin 'com.android.internal.version-check'.
» Minimum supported Gradle version is 7.0.2. Current version is 6.8. If using the gradle wrapper, try editing the distributionUrl in D:\Files\Code-Project\gradle\wrapper\gradle-wrapper.properties to gradle-7.0.2-all.zip
Now the error points me towards a problem within the "\gradle\wrapper\gradle-wrapper.properties"-file.
Looking into that I found out the real problem - the "\gradle"-folder was completely missing.

  • (Note: The ".gradle"-folder is not the same as the "\gradle"-folder)*
    Copying the "\gradle"-folder from another project solved my problems.

Now my "\gradle\wrapper\gradle-wrapper.properties"-file looks like this:

vuv7lop3

vuv7lop32#

接下来,在Android Studio中更新Gradle版本,选择使缓存无效并重新启动解决该问题。转到菜单文件-〉使缓存无效.. -〉使缓存无效并重新启动。

rta7y2nd

rta7y2nd3#

转到gradle Package 器属性

在分发url行中,将gradle版本从6.5更改为7.0.2或当前版本,此时您会看到

slmsl1lt

slmsl1lt4#

该错误指出您系统中的gradle版本低于您项目的gradle版本,这就是无法编译您项目的原因。

系统gradle版本项目的gradle版本

这里有两个解决方案
1.将android/gradle/wrapper目录下gradle-wrapper.properties文件中的分发URL更改为distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
1.更新您的Gradle插件。如果您使用某些环境变量,请从Gradle下载最新版本|手动安装,并将其替换为当前的安装。不要忘记更新系统属性中的path变量。

相关问题