2

I am trying to build android project based on Cordova but I have error as follows:

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

I am using cordova 6.4.0.

Please help me to solve this issue.

Santosh Shinde
  • 6,045
  • 7
  • 44
  • 68
pranav patwardhan
  • 105
  • 1
  • 2
  • 7
  • just execute the command the following commands. npm install -g cordova; cordova platform rm android; cordova platform add android – AnKr Aug 29 '18 at 04:02

3 Answers3

1

Actually, there is an issue where who are using Cordova older versions(eg. Cordova 6.4.0), From android SDK Tools, Revision 25.2.3 (November 2016) onwards they have removed templates folder from the tools which are required to create build till cordova-android@6.2.2.

Use following steps it will help you,

  1. Download the tools_r25.2.3-macosx.zip/tools_r25.2.3-windows.zip from here
  2. Extract the zip
  3. Go to Android SDK path then go to in your tools folder Replaced ..\AppData\Local\Android\sdk\tools with extracted sub-folder of tools/ (templates folder)
  4. And now do the build process again, your issue will be resolved.

    $ cordova build android / cordova run android

Also please check the similar type of question from here.

Hopes this will help you !!

Santosh Shinde
  • 6,045
  • 7
  • 44
  • 68
1

just execute the following commands.

npm install -g cordova; cordova platform rm android; cordova platform add android;

It will update you cordova to latest version and remove and add the platform newly.

Thanks

AnKr
  • 433
  • 1
  • 6
  • 20
0

Solution for above question

Those who are using cordova older versions(eg. cordova 6.4.0), i.e. Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK so solution for this is as follows

Download the tools_r25.2.3-macosx.zip from https://developer.android.com/studio/releases/sdk-tools.html link Extract it and copy the templates folder from it Go to android sdk path then go in tools folder Paste the templates folder here And now do the build process again, your issue will be resolved. Why this issue From SDK Tools, Revision 25.2.3 (November 2016) onwards they have removed templates folder from the tools which is required to create build till cordova-android@6.2.2.

Santosh Shinde
  • 6,045
  • 7
  • 44
  • 68
pranav patwardhan
  • 105
  • 1
  • 2
  • 7