this is really makes me frustated, i searched for the solution for this but i nothing is working. if check on terminal my java version, it's version 16 but when i try to run flutter in android emulator it read java 1.8. Im running on macOs Monterey and with msvcode
A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
CodePudding user response:
i think you have to upgrade your JDK version and make it 1.8 to11
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
CodePudding user response:
1.In Android Studio, navigate to File -> Project Structure or press Ctrl Alt Shift S to open project structure.
2.In Platform Settings -> SDKS -> Android API -> Java SDK (Now choose JDK as per your requirement).