Solution :
I know such errors are really hard to fix for beginners.
If you are windows user then you can follow below procedure to fix it.
At the beginning you need to download the Gradle binary.
After downloading just extract your zip file to 'C:\Gradle' or your preferred folder
Then you need to open the edit environment variable dialog from your start menu > Search
Now click on 'New' under your system variables and then add as below
The Variable Name GRADLE_HOME
and Variable Value C:\Gradle\gradle-4.0.1
After that you can choose PATH
variable from your system variable list
Then you need to append your gradle path to variable value as follows C:\Gradle\gradle-4.0.1\bin
Now press the win Key+R and type cmd then enter > in the command terminal type gradle -v
If you done the setup correctly then you will see your gradle installation details.