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

**URL:** <https://forum.ionicframework.com/t/error-could-not-find-gradle-wrapper-within-android-sdk-might-need-to-update-yo-ur-android-sdk/22056>\
**Category:** ionic-v1\
**Created:** [May 2, 2015, 9:52am UTC](https://forum.ionicframework.com/t/error-could-not-find-gradle-wrapper-within-android-sdk-might-need-to-update-yo-ur-android-sdk/22056 "2015-05-02T09:52:56Z")\
**Posts on this page:** 1\
**Showing post:** 83

<div class="post-metadata">

**Author:** ![gusgonnet](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gusgonnet/32/121606_2.png) [@gusgonnet](https://forum.ionicframework.com/u/gusgonnet)\
**Post date:** [September 2, 2018, 2:23am UTC](https://forum.ionicframework.com/t/error-could-not-find-gradle-wrapper-within-android-sdk-might-need-to-update-yo-ur-android-sdk/22056/83 "2018-09-02T02:23:38Z")

</div>

**Ubuntu 14.04 fix**

Hi there,  
I was suffering from this issue and the things I tried from above didn’t help me.  
I ended up creating the templates directory and copying the gradle wrapper from an existing project to fix it.

This was the error I got when running **ionic cordova build android** :

```auto
$ ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
[20:22:51] ionic-app-scripts 3.1.8

<build blah blah>

> cordova build android
ANDROID_HOME=/home/gust/Android/Sdk
JAVA_HOME=/opt/jdk
(node:10631) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 
Could not find gradle wrapper within Android SDK. 
Might need to update your Android SDK.
Looked here: /home/gust/Android/Sdk/tools/templates/gradle/wrapper
$

```

This was happening even though I had recently installed Android Studio and the Android SDK (in Aug 2018).

* * *

**Fix:**  
The error was pretty explicit:

```auto
Looked here: /home/gust/Android/Sdk/tools/templates/gradle/wrapper

```

So I tried to give Cordova what it wanted by creating the folder manually:

`$ cd /home/gust/Android/Sdk/tools`  
`$ mkdir -p templates/gradle/wrapper`

And then I copied the wrapper from an existing project I had around that used gradle already. The contents of /home/gust/Android/Sdk/tools/templates/gradle/wrapper ended up looking like this:

```auto
.
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
└── gradlew.bat

```

And with that, Cordova was happy and gave me the apk I wanted:

```auto
$ ionic cordova build android

<build blah blah>

BUILD SUCCESSFUL

Total time: 11.874 secs
Built the following apk(s): 
	/home/gust/ionic/myIonicApp/platforms/android/build/outputs/apk/android-debug.apk
$

```

Info about Cordova itself:

```auto
$ cordova platform version android
Installed platforms:
  android 6.1.2
Available platforms: 
  amazon-fireos ~3.6.3 (deprecated)
  blackberry10 ~3.8.0
  browser ~4.1.0
  firefoxos ~3.6.3
  ubuntu ~4.3.4
  webos ~3.7.0
$ cordova --version
6.5.0

```

You can find more info about how to generate a gradle wrapper yourself [in the Gradle Docs](https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:adding_wrapper).

Cheers!  
Gustavo.

---

_[View the full topic](https://forum.ionicframework.com/t/error-could-not-find-gradle-wrapper-within-android-sdk-might-need-to-update-yo-ur-android-sdk/22056)._
