Windows solution method:
sudo chmod 755 "/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle"
macOS or Linux solution method:
1) sudo chown -R $USER:$GROUP ~/.npm
2) sudo chown -R $USER:$GROUP ~/.config
Using an earlier version of Android Studio certainly will work, too. You can also install the Android SDK and gradle by itself, which is what I do.