Error: Could not find gradle wrapper within android sdk. Might need to update yo ur Android SDK

thanks @TomCosta it worked for me

2 Likes

Thank you sir!It really helped a lot!

Thanks. It worked finally. :slight_smile:

You fixed it bro. Thanks for your help!

Thanks DaCookie

it worked for me too

DaCookie U da real MVP

Thanks @TomCosta, this solution worked for me.

1 Like

thank you @TomCosta .

1 Like

I am still getting issue after copying files. Strange thing is why Android home is printed with some linux kind of directory. I have windows machine.

E:\Work\workspace\IonicSample>ionic package info
:heavy_check_mark: Retrieving latest build information - done!

id | 7
status | FAILED
platform | Android
mode | debug
profile | ionicsample
started | 2017-07-06T18:30:34.480Z
finished |

output:
ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /opt/android-sdk/tools/templates/gradle/wrapper

E:\Work\workspace\IonicSample>echo %ANDROID_HOME%
E:\Softwares\Installed\Android\sdk

E:\Work\workspace\IonicSample>echo %java_HOME%
E:\Softwares\Installed\Java\jdk1.8.0_131

Update

  • As mentioned in earlier post I tried updating cordova-android

E:\Work\workspace\IonicSample>cordova platform update android@6.2.2
Using cordova-fetch for cordova-android@6.2.2
Error: Platform ā€œandroidā€ is not yet added. See cordova platform list.

as per error I added it first as below
cordova platform add android@6.2.2

I also downloaded older version of sdk/tools tools_r25.2.3-windows.zip and replaced in sdk/tools to get templates/gradle/wrapper folder and it solved my issue.

Because you are using ionic package to build, which is a remote cloud service. The build is done on the server, you donā€™t even need Android and Java locally for that.

You can either use ionic cordova build android to build locally or install cordova-android 6.2.3 so the remote service can work again. (Post your ionic info output)

ok, I realized that I was always looking into ionic service documentation. Thanks for reminding. I found now ionic main tutorial.

1 Like

Download tools_r25.2.3-windows.zip from Android Downloads.
Extracted zip on desktop
Replaced C:\Users\username\AppData\Local\Android\sdk\tools with extracted sub-folder tools/
In project folder:

$ cordova platforms remove android
$ cordova platforms add android

@DaCookie orked for me . Thanks

Thanksā€¦ Itā€™s work for me.

Iā€™m working on Linux and upgrading ā€œCordova Androidā€ to 6.2.3 as described above and adding following in .profile did the trick:

export PATH=$PATH:/opt/android-studio/current/gradle/gradle-3.2/bin

Obviously you have to adapt the directory to your environment.

Worked for me, thanks!

I am on ionic 3.16.0 and cordova 6.5.0 and the latest version of the android studio. Since there have been structural changes, gradle\wrapper no longer resides in sdk\tools directory.

I discovered that in my config.xml the engine for android was set as <engine name="android" spec="~6.1.2" />. All I had to do was change this to <engine name="android" spec="~6.2.2" /> and everything worked like a charm.

Thank you much
worked like a charm

After spending hours on same problem, I thought only god could help me ā€¦ and Godā€™s other name is @DaCookie ! U brilliant beauty !

Hi! I tried everything but the only thing that worked for me was to install gradle.

Hope this help :+1: