Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova gradle wrapper missing in android sdk

I'm on windows7 x64, installed today's latest stable release of android sdk studio (through android studio bundle, since it's shipped together now apparently). I have properly configured the environment variables as you'll see above.

This is what I get when issuing the following command

$ cordova build android

ANDROID_HOME=G:\installs\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: G:\installs\Android\sdk\tools\templates\gradle\wrapper

And indeed, the "templates" directory doesn't even exist in my sdk install.

I've already tried the suggestions (setting the right path, uninstall/reinstall) of this question here but nothing applies to my case, and I find that manually copying and pasting packages is not really a solution, since there's a package manager in place.

If anybody has an answer as of today's android install, would be very much appreciated.

like image 686
wiwi Avatar asked Mar 07 '17 15:03

wiwi


3 Answers

If still not working then copy all file from gradle\wrapper from Android Studio installation folder

C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle\wrapper

and paste it in your Android SDK gradle\wrapper then run same command.

E:\android-sdk\tools\templates\gradle\wrapper

like image 55
Gaurab Kumar Avatar answered Sep 23 '22 16:09

Gaurab Kumar


This is a known issue; see CB-12544. For now you'll need to downgrade.

like image 40
Kerri Shotts Avatar answered Sep 23 '22 16:09

Kerri Shotts


I downloaded Android SDK r25 manually and placed templates folder inside Android/sdk/tools. This solved the issue for me. You can get it from https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip

For Windows:

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

Go to the section :"Get just the command line tools"

There is a link 'sdk-tools-darwin-3859397.zip' for Mac, Unfortunately that didn't have the templates folder with Gradle Wrapper. So for Mac users, i will suggest not to go for this zip.

like image 28
Siena Avatar answered Sep 24 '22 16:09

Siena