Building Android error - missing gradle wrapper

Hi I’m trying to build for Android and I get this error:
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /home/carlos/Android/Sdk/tools/templates/gradle/wrapper

It is suggested that I update Android SDK. I did a complete re-install to clean everything up. But the problem still persists. The problem lies in that there simply is no templates folder in the Android SDK and there isn’t a single file named ‘gradle’ in the directory.

How do I get the gradle wrapper?

Thanks

Ok if anyone else gets this error this is the solution:

Download the SDK Command Line Tools Rev 25.2.4 and not higher.
Unzip the folder and copy the /tools/templates folder and paste it in /home/you/Android/Sdk/tools/ folder.

https://developer.android.com/studio/index.html#downloads

3 Likes

Or upgrade cordova-android to the not-yet-released 6.2.2 that should work with the newest SDK: cordova platform update https://github.com/apache/cordova-android#6.2.2

3 Likes

that’s great thank you

This took care of it for me. Thank you!

Thank for the alternative. I attempted the command you posted and it complained about not being able to download something null.

I ran ionic cordova platform update android@6.2.2 and it seems to have done the trick

1 Like

Unable to find templates folder in the downloaded zip file