Accepted answer

"Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK."

Update Android SDK.

or you can just install Android Studio as it will take care of all of that
and make sure using the most recent Cordova and cordova-android versions.



solved it by updating cordova globally, and the local platform package :

npm install -g cordova
cd my_project
cordova platform update android

Cordova guidelines (https://cordova.apache.org/announcements/2017/04/05/android-release.html 106)

Doing so also updated the gradle config.

Use current version of Cordova, 7.0.1. Uninstall and reinstall Cordova. (npm uninstall cordova -gnpm install -g cordova)
Then remove and readd the android platform again. (ionic cordova platform remove androidionic cordova platform add android)

You can try to changed ANDROID_HOME from
C:\Users\<NAME>\AppData\Local\Android\Sdk
to
C:\Users\<NAME>\AppData\Local\Android\Sdk\tools\Sdk

npm update -g cordova

did the trick for me.

Then I removed the platform and added it again.

ionic platform remove android

ionic platform add android

This works for me in Ionic. I am sure cordova platform remove/add android will do the same stuff. Not tested though.

I have my version stored in package.json, I updated to 6.2.3, re-added the platform then the build worked on ionic io.

  "cordovaPlatforms": [
    {
      "platform": "android",
      "version": "6.2.3",
      "locator": "android"
    },
  ]

I was using 6.1.0 before, so my guess is 6.1.0 and older aren’t compatible with the latest android sdk tools (26.0.1), which was added in 6.2.2

Make sure ANDROID_HOME includes the version number of the Android API you’re targeting, e.g.:

… in ~/.bash_profile:

export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.1.2
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

have same error: could not find gradle wrapper within android sdk when i build ionic, but i was solve. I just download Android SDK tools package 19.6k and copy extract file to C:\Users\CURRENT_USER\AppData\Local\Android\sdk and build ionic/cordova again.

its work for me.

Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /Users/melodycguitarista/Library/Android/sdk/tools/templates/gradle/wrapper

some link give solution to download tools_r25.2.5-macosx.zip
i copy and replaced all in folder
/Users/melodycguitarista/Library/Android/sdk/tools/templates/gradle/wrapper
and try running again ionic build android
for some while BUILD SUCCESSFUL

Total time: 8 mins 9.394 secs

Built the following apk(s):
/Users/melodycguitarista/DEsktop/icymobile/platforms/android/build/outputs/apk/android-debug.apk

Builder builder = LatLngBounds.builder();

Error you need to open platforms -> android -> project.properties

and update the google play services library to “+”

cordova.system.library.8=com.google.android.gms:play-services-maps:+
cordova.system.library.9=com.google.android.gms:play-services-location:+

this works for me