0

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.

enter image description here

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.

iDecode
  • 12,616
  • 7
  • 58
  • 106
  • Have you ever used IntelliJ IDEA with this project? – Andrey Nov 30 '21 at 16:14
  • Try this: https://stackoverflow.com/a/21212790/2000323 – Andrey Nov 30 '21 at 16:14
  • @Andrey No, I didn't use IntelliJ IDEA for this project. Thanks for the link, I knew how to do that in gradle file but I'm curious to know why my Flutter project is having this issue. – iDecode Dec 01 '21 at 07:52

0 Answers0