# "ionic cordova build android" failed - could not find an installed version of Gradle

**URL:** <https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074>\
**Category:** ionic-v3\
**Created:** [May 29, 2017, 1:44am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074 "2017-05-29T01:44:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alejandrocao](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/alejandrocao/32/101995_2.png) [@alejandrocao](https://forum.ionicframework.com/u/alejandrocao)\
**Post date:** [May 29, 2017, 1:44am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074/1 "2017-05-29T01:44:15Z")

</div>

I’m getting the following error when building android app locally:

ionic cordova build android  
Running app-scripts build: --iscordovaserve --external-ip-required --nobrowser

[22:35:07] build dev started …  
[22:35:07] clean started …  
[22:35:07] clean finished in less than 1 ms  
[22:35:07] copy started …  
[22:35:07] transpile started …  
[22:35:11] transpile finished in 3.77 s  
[22:35:11] preprocess started …  
[22:35:11] deeplinks started …  
[22:35:11] deeplinks finished in 15 ms  
[22:35:11] preprocess finished in 15 ms  
[22:35:11] webpack started …  
[22:35:11] copy finished in 4.44 s  
[22:35:21] webpack finished in 10.32 s  
[22:35:21] sass started …  
[22:35:23] sass finished in 2.08 s  
[22:35:23] postprocess started …  
[22:35:23] postprocess finished in 13 ms  
[22:35:23] lint started …  
[22:35:23] build dev finished in 16.26 s

> cordova build android  
> ✖ Running command - failed!

[ERROR] Cordova encountered an error.  
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build android (exit code 1):

```
    ANDROID_HOME=D:\Desarrollo\AndroidSDKTools
    JAVA_HOME=C:\Program Files\Java\jdk1.8.0_51
    Error: Could not find an installed version of Gradle either in Android Studio,
    or on your system to install the gradle wrapper. Please include gradle
    in your path, or install Android Studio

```

This is my environment configuration:

ionic info

global packages:

```
@ionic/cli-utils : 1.2.0
Cordova CLI : 7.0.1
Ionic CLI : 3.2.0

```

local packages:

```
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.2.1
@ionic/cli-plugin-ionic-angular : 1.2.0
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.3.0

```

System:

```
Node : v6.10.2
OS : Windows 10
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed

```

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 29, 2017, 7:34am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074/2 "2017-05-29T07:34:09Z")

</div>

> [@alejandrocao](#):
>
> Please include gradle  
> in your path, or install Android Studio

So did you do what the error message tells you to do?

---

<div class="post-metadata">

**Author:** ![alejandrocao](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/alejandrocao/32/101995_2.png) [@alejandrocao](https://forum.ionicframework.com/u/alejandrocao)\
**Post date:** [May 29, 2017, 3:28pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074/3 "2017-05-29T15:28:46Z")

</div>

No. I never had to install or configure gradle … did anything change with the new version of cordova or ionic, or is it the new version of android sdk?

[Https://cordova.apache.org/docs/en/latest/guide/platforms/android/#configuring-gradle](Https://cordova.apache.org/docs/en/latest/guide/platforms/android/#configuring-gradle)

What is the best way to install or configure it?

Thanks,  
Alejandro

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 29, 2017, 7:13pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074/4 "2017-05-29T19:13:04Z")

</div>

Download and install Android Studio - should take care of most of the stuff automagically.

And yes, Android SDK is moving stuff around with minor and even patch releases. cordova-android is trying to keep up, but it’s very hard.

---

<div class="post-metadata">

**Author:** ![mtsecurit](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mtsecurit](https://forum.ionicframework.com/u/mtsecurit)\
**Post date:** [June 20, 2017, 12:25pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074/5 "2017-06-20T12:25:41Z")

</div>

I have android studio installed and it has all functioned perfectly for months. So why should this happen now. I tried to removed a plugin (crosswalk) tried to install a new one (with the lite flag) this failed. They when trying to run android I get these issues.

I have re-added the platform with no luck.  
Any tips or ideas.

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [June 20, 2017, 1:10pm UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074/6 "2017-06-20T13:10:54Z")

</div>

Open a new topic and include all relevant information please. (`ionic info`, error message, command executed etc)

---

<div class="post-metadata">

**Author:** ![mtsecurit](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mtsecurit](https://forum.ionicframework.com/u/mtsecurit)\
**Post date:** [June 21, 2017, 8:48am UTC](https://forum.ionicframework.com/t/ionic-cordova-build-android-failed-could-not-find-an-installed-version-of-gradle/92074/7 "2017-06-21T08:48:28Z")

</div>

I fixed it in the end by installing Gradle separately. Works lovely now. Thanks for the response
