The differences between gradle for Android Studio 8.6 and the original 4.x that the example projects were set up for are vastly different.
I can't get a recent version of Android Studio to build these projects, is there any chance you can get this working, 4.x is so old now that hardly anyone uses it anymore.