If you open a project in Android Studio and see an error similar to this:
No matching variant of com.android.tools.build:gradle:7.4.1 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:
![Solving Error 1](https://appzmotion.com/wp-content/uploads/2023/02/Snap_2023.02.23_15h26m57s_002.png)
This is a Java version error, to solve this follow the steps below:
- Go to menu File -> Settings.
- Go to Build, Execution, Deployment -> Build Tools -> Gradle and change Gradle JDK to version 11. Then click Apply and OK.
- Sync your project again (press Try Again) or restart your project.