Gradle Sync Failing


I am trying to run a BLE scanner App in android studio. Found here: GitHub - joelwass/Android-BLE-Scan-Example: This is a simple example app that turns on ble and scans for devices, listing them out. It's for Android API 23

The initial error was to do with Gradle 2.8 being required. Upon installing and syncing this version, i received an error saying that my android studio supports anything newer than Gradle 4.8.1.

How do i change my android studio code to successfully sync with a newer version of gradle? Allowing me to use the code which needs version 2.8, with version 4.8.1