How to solve "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8"
I have recently encountered an issue when trying to create a local build on my Mac (M1), and since I couldn’t find a solution on Stack Overflow or other forums I have decided to post my own solution in case anybody needs it.
To make it work, follow these 5 steps below:
- Go to Oracle website, download and install the JAVA SE Development Kit. If you need step by step instruction, check oracle documentation.
- Download and install the latest version of Android Studio:
- After you have successfully installed Android Studio, open the application and select preferences. Check the image below. I have selected Appearance and Behavior => System Settings => Android SDK => SDK Tools.
- From this section, install the packages below. Check Show package details to select specific version.
- Click on apply changes for those packages to install. When the installation is done, restart your IDE and try again.
Good luck! 🏆🚀 Let me know if you encountered any challenges.