解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

目录

问题截图:

错误代码:

错误原因:

解决方法:


今天在打开项目的时候遇到了一些问题:

问题截图:

解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

错误代码:

如下:

No matching variant of com.android.tools.build:gradle:7.4.0 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute ‘org.gradle.plugin.api-version’ with value ‘7.5’ but:……

 解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

错误原因:

这个原因是最新的Android Studio所用的gradle需要使用jdk11才能构建 ,而我的系统中用的是jdk8,因此要更改 Android Studio 的jdk版本。


我现在的使用的 Android Studio 版本:

解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)


 

解决方法:

解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

 解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

 解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

 解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

 

先看看选项中有没有jdk11的版本,有的话直接选中运行

如果没有的话,下载一个:

解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

 解决Android Studio-jdk版本不符问题(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

 等待下载完成后,重新运行项目就可以运行了!


现在你的项目运行成功了吗???别忘了点个赞再走哦!!!

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/8618d9daf8.html