# Cannot Build Android APK - IONIC 4

**URL:** <https://forum.ionicframework.com/t/cannot-build-android-apk-ionic-4/184154>\
**Category:** Ionic Framework\
**Created:** [February 28, 2020, 6:50am UTC](https://forum.ionicframework.com/t/cannot-build-android-apk-ionic-4/184154 "2020-02-28T06:50:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pamzz](https://avatars.discourse-cdn.com/v4/letter/p/ac91a4/32.png) [@pamzz](https://forum.ionicframework.com/u/pamzz)\
**Post date:** [February 28, 2020, 6:50am UTC](https://forum.ionicframework.com/t/cannot-build-android-apk-ionic-4/184154/1 "2020-02-28T06:50:52Z")

</div>

I has installed jdk 8 and latest android studio, gradle and i also set environment variable for java\_home ,android\_home,gradle\_home but showing this error

> Checking Java JDK and Android SDK versions  
> ANDROID\_SDK\_ROOT=undefined (recommended setting)  
> ANDROID\_HOME=C:\Users\A-11\AppData\Local\Android\Sdk (DEPRECATED)  
> 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  
> [ERROR] An error occurred while running subprocess cordova.
> 
> ```
> cordova.cmd build android exited with exit code 1.
> 
> Re-running this command with the --verbose flag may provide more information.
> 
> ```

i cannot build the android apk, Any one help…

---

<div class="post-metadata">

**Author:** ![TaGi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tagi/32/120856_2.png) [@TaGi](https://forum.ionicframework.com/u/TaGi)\
**Post date:** [February 28, 2020, 8:18am UTC](https://forum.ionicframework.com/t/cannot-build-android-apk-ionic-4/184154/2 "2020-02-28T08:18:32Z")

</div>

Solution is [here](https://github.com/ionic-team/ionic/issues/11591)

---

<div class="post-metadata">

**Author:** ![pamzz](https://avatars.discourse-cdn.com/v4/letter/p/ac91a4/32.png) [@pamzz](https://forum.ionicframework.com/u/pamzz)\
**Post date:** [February 28, 2020, 9:13am UTC](https://forum.ionicframework.com/t/cannot-build-android-apk-ionic-4/184154/3 "2020-02-28T09:13:33Z")

</div>

I already installed `gradle` by own. but still i have facing this problem

---

<div class="post-metadata">

**Author:** ![LacOniC](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/laconic/32/130566_2.png) [@LacOniC](https://forum.ionicframework.com/u/LacOniC)\
**Post date:** [February 28, 2020, 10:29am UTC](https://forum.ionicframework.com/t/cannot-build-android-apk-ionic-4/184154/4 "2020-02-28T10:29:37Z")

</div>

ANDROID\_SDK\_ROOT should be defined. For Mac:

`vim ~/.bash_profile`

add this (your path to sdk) to bash\_profile

> export ANDROID\_SDK\_ROOT=/Users/XXX/Library/Android/sdk

then run

`source ~/.bash_profile`

`echo $ANDROID_SDK_ROOT`

---

<div class="post-metadata">

**Author:** ![devsalimsulaiman](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/devsalimsulaiman/32/144076_2.png) [@devsalimsulaiman](https://forum.ionicframework.com/u/devsalimsulaiman)\
**Post date:** [July 26, 2020, 8:48am UTC](https://forum.ionicframework.com/t/cannot-build-android-apk-ionic-4/184154/5 "2020-07-26T08:48:28Z")

</div>

hi! i am having same issue on windows. pls any help?
