(1) Start Android Studio and load your project.

(2) Go to gradle-wrapper.properties file and change the distribution URL to the version you want.

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

All available versions can be found in the link below: https://services.gradle.org/distributions/

(3) Go to your app-level build.gradle file and change the Android gradle plugin version.

classpath 'com.android.tools.build:gradle:3.0.1'

All available versions and their matching Gradle requirement can be found int he link below: https://developer.android.com/studio/releases/gradle-plugin.html

(4) Finally, choose to "Sync Gradle" and that is all.