after struggling with this issue for a while, I finally found a solution that worked for me! Just set the Gradle JDK in File > Settings > Build, Execution, Deployment > Gradle to a compatible version like Amazon Corretto 17 to fix the issue.enter image description here