I have changed sourceCompatibility and targetCompatibility to JavaVersion.VERSION_11 in build. gradle files for all modules. In my PC I have JDK 11, JAVA_HOME and path are ok, in project:
But I still get
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.homeingradle.properties`
my gradle.properties:
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.parallel=true android.useAndroidX=true android.enableJetifier=true

 
    

 
    