Whenever I open my Flutter project's android
module in Android Studio, it gives me the following error:
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
To solve it, I open Gradle settings and change Gradle JDK from 1.8
to 11
, hit Apply button and it works.
However, if I reopen the same project (after closing), it resets my JDK to 1.8
. I need to set it to 11
again. What am I doing wrong?
PS: My other Android projects (native ones using Java) does remember the last selected JDK version.