I am also facing this problem, I solved it this way
Go to Android Studio Settings
Settings > Build, Execution > Build Tool > Gradle
and set Gradle JDK path with JAVA_HOME