Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing Gradle in Android SDK (using cordova + ionic)

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

like image 834
aluknot Avatar asked Oct 14 '15 11:10

aluknot


People also ask

Do I need Android SDK for ionic?

We don't recommend using Android Studio for developing Ionic apps. Instead, it should only really be used to build and run your apps for the native Android platform and to manage the Android SDK and virtual devices.


1 Answers

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

like image 183
ejke Avatar answered Oct 15 '22 07:10

ejke