Failed to apply plugin 'com.android.internal.application'. Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
How can I change the version of Java used by the project? Download the corresponding version. I run the project from Visual Studio Code.
Add this code in "my-project/android/gradle.properties"
org.gradle.java.home=C:\Program Files\Java\jdk-11.0.14
But I get the following error:
Value 'C:Program FilesJavajdk-11.0.14' given for org.gradle.java.home Gradle property is invalid (Java home supplied is invalid)