I have added JAVA 11 to android studio to Build Tools -> Gradle like below:
Still when checking source it still shows JAVA 8:
java -version shows:
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11 0-b60-7772763)
OpenJDK 64-Bit Server VM (build 11.0.11 0-b60-7772763, mixed mode)
CodePudding user response:
Try first to invalidate cache and watch carefully with XMLs Android studio need a proper cross checking but strangely its configuration process is not properly align.
If unable to do this restore /Reset Android Studio then Add/Enable JAVA.
CodePudding user response:
Don't forget to add java version in app level build.gradle file.
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}