Solve the problem of Android Studio-jdk version mismatch (No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

Table of contents

Screenshot of the problem:

error code:

wrong reason:

Solution:


I encountered some problems when opening the project today:

Screenshot of the problem:

error code:

as follows:

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:......

 

wrong reason:

The reason for this is that the gradle used by the latest Android Studio needs to be built using jdk11 , and jdk8 is used in my system , so  the jdk version of Android Studio needs to be changed.  


 The Android Studio  version I am using now :


 

Solution:

 

 

 

 

First check if there is a version of jdk11 in the options, if so, just select and run

If not, download one:

 

 After waiting for the download to complete, re-run the project to run it!


Is your project running successfully now? ? ? Don't forget to like and leave! ! !

Guess you like

Origin blog.csdn.net/m0_66019257/article/details/130872226