16

Yep, i searched about this but nothing, just things about the ANDROID_HOME path, but in my case i don't think this is the real problem. When i try to do ionic build android i get this error:

Error: Could not find gradle wrapper within android sdk. Might need to update yo ur Android SDK. Looked here: C:\Android\sdk\tools\templates\gradle\wrapper

And found that in C:\Android\sdk\tools i dont have "templates" folder, just this:

sdk tools folder

I see gradle wrapper only in this path C:\Android\sdk\temp\ToolPackage.old01\templates\gradle\wrapper

Why i don't have Gradle in my sdk folder? i am missing something? in SDK manager i have this installed:

enter image description here

Thanks in advance

aluknot
  • 504
  • 2
  • 7
  • 20

9 Answers9

26

Had exactly the same problem. This thread points out the reason behind it, and this one actually shows what to do.

In short:

  • in Android Studio uninstall Android SDK Tools
  • Download tools_r25.2.3-yourOPsystem.zip from Android Downloads. Basicly same thing, older version.
  • insert downloaded extracted tools folder in Android/sdk/ folder
    (MAC: /Users/username/Library/Android/sdk/tools
    Win: C:\Users\username\AppData\Local\Android\sdk\tools)

  • In project folder run:

$ cordova platforms remove android

$ cordova platforms add android

Community
  • 1
  • 1
ejke
  • 380
  • 4
  • 7
  • This is totally different, the question is from 2015 and this problem is new. The questions you link are for the new problem and your fix too. – jcesarmobile Mar 22 '17 at 08:21
  • You are indeed correct about it. So anyone who is looking for a fix for 2015 problem, should keep looking, others may find relief here. – ejke Mar 27 '17 at 13:20
  • for those who don't have android studio but just the sdk manager tool, type in "sdkmanager tools" what you need will be installed – KitAndKat Apr 29 '17 at 17:56
8

On Linux android studio version-162.3871768-linux copy paste

\Android Studio\plugins\android\lib\templates\

to Sdk/tools/

Keshav Bhatt
  • 171
  • 1
  • 5
5

You need to update ANDROID_HOME variable to point the android-sdk folder https://stackoverflow.com/a/32507036/344895

Community
  • 1
  • 1
Madman
  • 3,171
  • 2
  • 32
  • 44
  • 1
    No problem. The solution I reference in the answer helped me when I faced with the same issue – Madman Sep 21 '16 at 09:10
2

you have to upgrade your cordova library

cordova platform update android@6.2.1
user3808923
  • 49
  • 1
  • 5
1

I tested upgrade cordova to version 6.5 and extract tools SDK. Nothing helps. In my case I have Android Studio installation.

SOLUTION: Please find file gradle-wrapper.jar in your Android Studio installation (in may case ..\Android Studio\plugins\android\lib\templates\gradle\wrapper\gradle\wrapper\ ). Then copy whole directory templates to SDK location in subfolder tools.

piet.t
  • 11,718
  • 21
  • 43
  • 52
hsd
  • 452
  • 5
  • 12
0

Set ANDROID_HOME to the SDK Path displayed in your Android SDK Manager. The default location is C:\Program Files (x86)\Android\android-sdk if you didn't change it.

MikeH
  • 21
  • 3
0

go to https://developer.android.com/studio/index.html cheak Download Option and download tools only extact file and copy the templates folder and paste in C:\Users(yourunername)\AppData\Local\Android\sdk\tools

0

update your sdk tools download tools_r25.2.3-yourOPsystem.zip. [direct download link][1]

/Users/username/Library/android/sdk/tools

erwin
  • 1
  • 1
  • please use this link.. https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiDjNCf_73TAhVI64MKHbhuDyUQFgglMAA&url=https%3A%2F%2Fdl.google.com%2Fandroid%2Frepository%2Ftools_r25.2.3-windows.zip%3Fhl%3Did&usg=AFQjCNFpLJ8y-MbcXbY9gatR-oyFyVN3wQ&sig2=qlsSQ-3SHMGgR1PqGWWK-g – erwin Apr 24 '17 at 21:31
0

You cant find gradle in latest sdk. So try to install it manually. Follow this link

https://gradle.org/install

Arjun G
  • 2,194
  • 1
  • 18
  • 19