To solve this issue, in your Android Studio go to File -> Settings.
In settings choose Build, Execution, Deployment -> Build Tools -> Gradle
and select "Use default gradle wrapper (recommended)" option.
After rebuild your build.gradle will be totally fine.