If you try to build your ionic/cordova project running with
cordova build --release android
and the shell returns the following error
Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
the following worked for me:
cordova platform remove android cordova platform add android cordova platform update email@example.com cordova build --release android
There is nothing wrong with your gradle installation nor with your Android SDK. It looks like an error specific to cordova 6.2.0 and was fixed in cordova 6.2.1. At the time of writing, cordova installed 6.2.0 instead of version 6.2.1, so you need to manually update.