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

Thanks @dacookie! Quick fix for me as well.

Good catch, worked for me. Found that you need to be careful with where the gradle wrapper is located when using multiple disks (i.e. SSD and HDD on the same laptop!). Seems to be a bit easier when everything is installed on the same disk.

Android SDK tools have been updated to 25.3 and it doesn’t have template folder anymore. Do not update SDK tools to 25.3.X.

3 Likes

There soon will be a new version of cordova-android that will fix these problems. For now you can use the old tools or use the still-in-development version of cordova-android: http://stackoverflow.com/a/42797817/252627

2 Likes

Thanks, fixed “gradle wrapper” issue, but ionic emulate dont work anyway, it seems that ionic needs older sdk where android was CLI, now typing android to CL tells me that it is deprecated. So ionic emulate command die with error.

I use ionic run android and if there is no device connected, emulator starts automatically. I have installed latest android platform and build tools but SDK tools still in version 25.2.3.

Thanks @trisna1192… Ur solution really worked for me.
Just a small update, For mac users, paste the extracted file in ~/Library/Android/sdk folder.

Thank you very much. I tried it before and it didn’t work. Today I formatted my Mac and reinstalled everything, did that and it’s not show that error any longer, just others haha.

Thanks @DaCookie. its working now.

Thanks for sharing! :slight_smile:

Great! Thanks so much, it worked like a charm!

Followed @daCookie’s advice. Fixed my problem. Download the file, move the templates/ directory into your sdk/tools/, and I was able to build.

Thanks

This worked for me!!!

Take a look at:
https://cordova.apache.org/announcements/2017/04/05/android-release.html

2 Likes

This worked for me! Thanks brickolicious.

Windows 10

1 Like

Worked for me on w7! Thanks

this worked. thanks!

1 Like

Thanks, DaCookie!
U saved my day. :+1:

@DaCookie

I am use windows 10 and i a, getting same error Please help me.

Error:


F:\2 IONIC 2\MyIonic2TabProject>ionic run android

> ionic-hello-world@ ionic:build F:\2 IONIC 2\MyIonic2TabProject
> ionic-app-scripts build

[16:55:40]  ionic-app-scripts 1.3.0
[16:55:40]  build dev started ...
[16:55:40]  clean started ...
[16:55:40]  clean finished in 4 ms
[16:55:40]  copy started ...
[16:55:40]  transpile started ...
[16:55:43]  transpile finished in 3.19 s
[16:55:43]  preprocess started ...
[16:55:43]  deeplinks started ...
[16:55:43]  deeplinks finished in 17 ms
[16:55:43]  preprocess finished in 19 ms
[16:55:43]  webpack started ...
[16:55:43]  copy finished in 3.55 s
[16:55:53]  webpack finished in 9.52 s
[16:55:53]  sass started ...
[16:55:54]  sass finished in 1.02 s
[16:55:54]  postprocess started ...
[16:55:54]  postprocess finished in 72 ms
[16:55:54]  lint started ...
[16:55:54]  build dev finished in 13.87 s
[16:55:56]  lint finished in 2.32 s
ANDROID_HOME=F:\Android\android-sdk\android-sdk\platform-tools
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_60

Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: F:\Android\android-sdk\android-sdk\platform-tools\tools\templates\gradle\wrapper

I’m really confused… I had same issue. I did as @DaCookie advised. And finally it worked! But…
My client Android Studio recommended me to update it… And I did it… Damn! It doesn’t work again. And the tools folder doesn’t compile the project.

Currently error.

> ionic-app-scripts build

[18:07:30]  ionic-app-scripts 1.2.2 
[18:07:30]  build dev started ... 
[18:07:30]  clean started ... 
[18:07:30]  clean finished in 3 ms 
[18:07:30]  copy started ... 
[18:07:30]  transpile started ... 
[18:07:34]  transpile finished in 3.46 s 
[18:07:34]  preprocess started ... 
[18:07:34]  deeplinks started ... 
[18:07:34]  deeplinks finished in 71 ms 
[18:07:34]  preprocess finished in 73 ms 
[18:07:34]  webpack started ... 
[18:07:34]  copy finished in 3.94 s 
[18:07:44]  webpack finished in 10.06 s 
[18:07:44]  sass started ... 
[18:07:45]  sass finished in 1.33 s 
[18:07:45]  postprocess started ... 
[18:07:45]  postprocess finished in less than 1 ms 
[18:07:45]  lint started ... 
[18:07:45]  build dev finished in 14.96 s 
[18:07:48]  lint finished in 3.18 s 
ANDROID_HOME=/Users/oops/Library/Android/sdk

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home

Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /Users/oops/Library/Android/sdk/tools/templates/gradle/wrapper

With latest tools

:compileDebugJavaWithJavac


:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).

/Users/denis/Documents/Work/ionic-3-beta/platforms/android/src/plugin/google/maps/PluginUtil.java:135: error: cannot access AbstractSafeParcelable

    Builder builder = LatLngBounds.builder();

                                  ^

  class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

1 error

:compileDebugJavaWithJavac 
FAILED



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.

> Compilation failed; see the compiler error output for details.


* Try:

Run with 
--stacktrace option to get the stack trace. Run with --info or --debug
 option to get more log output.


BUILD FAILED


How can I solve it?