# Problem on ionic build android (not $PATH related)

**URL:** <https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812>\
**Category:** ionic-v1\
**Created:** [December 29, 2014, 1:59am UTC](https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812 "2014-12-29T01:59:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcbytes](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@rcbytes](https://forum.ionicframework.com/u/rcbytes)\
**Post date:** [December 29, 2014, 1:59am UTC](https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812/1 "2014-12-29T01:59:30Z")

</div>

Hi !

I’m kinda new to Ionic but been developing with AngularJS for a while.  
Everything been working **superb** on localhost, but then I tried to build:

I added the platform:  
`ionic platform add android` **ok**

Then tried to build and got the following error:

```
ionic build android

```

TRANSLATION: **“Arquivo ou diretório não encontrado”** means **File or directory not found** , but they do! Can’t count how many times I checked.

 ![image](https://global.discourse-cdn.com/ionicframework/original/2X/7/7ea4b5b6efcd5976958ec5db6a101e91c55c70be.png)

I Created a brand new app and tried to build. Same error.

Can you help me please? Thanks in advance 😄

---

<div class="post-metadata">

**Author:** ![donny](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donny/32/7539_2.png) [@donny](https://forum.ionicframework.com/u/donny)\
**Post date:** [December 29, 2014, 6:19am UTC](https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812/2 "2014-12-29T06:19:43Z")

</div>

Hi,  
Try this perhaps it work  
Enter with root user

```
$ sudo su

```

Then add android platform

```
# cordova platform add android

```

if it’s not work try to check your permission

Then make sure u change permission of platforms directory

```
# chmod -R 775 /ionic-project/platforms

```

After that try to prepare and compile your project

```
# cordova prepare android
# cordova compile android

```

To try it using Android emulator or Genymotion, use this

```
# cordova run android
```

---

<div class="post-metadata">

**Author:** ![rcbytes](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@rcbytes](https://forum.ionicframework.com/u/rcbytes)\
**Post date:** [December 29, 2014, 12:24pm UTC](https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812/3 "2014-12-29T12:24:40Z")

</div>

Hi @donny thank you for your time 😄

I followed your steps, but got stuck on **compile** , same error, no directory found, now as root.

![image](https://global.discourse-cdn.com/ionicframework/original/3X/5/e/5eba45cc07c2ac8e1116505371ff09080759d01e.png)

Heres another pic of the error:  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/9/f/9fe3973a6ae9fb51b4832f6c9d2947f90c7033bc.png)

Any other suggestion?

---

<div class="post-metadata">

**Author:** ![donny](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donny/32/7539_2.png) [@donny](https://forum.ionicframework.com/u/donny)\
**Post date:** [December 30, 2014, 1:53am UTC](https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812/4 "2014-12-30T01:53:20Z")

</div>

Hm… that was unclear information  
"No Directory Found" it’s for platforms directory or android directory (inside platforms directory) ?

Ensure android directory has created inside platforms directory, if it’s not exist try to change permission of platforms directory to 777/775. then add platform again.  
if it’s still failed  
try this one

```
$ sudo su
# cordova platform rm android

```

remove “android.json” in plugins directory

```
# rm /plugins/android.json

```

then add android platform

```
# cordova platform add android

```

then prepare and compile your project

```
# cordova prepare android
# cordova compile android

```

if still error, try to copy your result and post it here

Perhaps it works 😉

---

<div class="post-metadata">

**Author:** ![rcbytes](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@rcbytes](https://forum.ionicframework.com/u/rcbytes)\
**Post date:** [December 30, 2014, 4:22am UTC](https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812/5 "2014-12-30T04:22:43Z")

</div>

Yeah, it’s kinda unclear since he talk about 2 directories in the same sentence, hehe but I checked and both exists and I put 777 permissios in both directories 😢

After I removed the platform, the file **android.json** wasn’t there anymore, so I didn’t need to delete.

The full error report is on gist (got the same error):  
[https://gist.github.com/rcbytes/5e224deeac63a9bc07f8](https://gist.github.com/rcbytes/5e224deeac63a9bc07f8)

Didn’t know if it’d be formatted corretly by this editor, thank ya again @donny

---

<div class="post-metadata">

**Author:** ![donny](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donny/32/7539_2.png) [@donny](https://forum.ionicframework.com/u/donny)\
**Post date:** [December 30, 2014, 4:41am UTC](https://forum.ionicframework.com/t/problem-on-ionic-build-android-not-path-related/14812/6 "2014-12-30T04:41:00Z")

</div>

Hm… actualy after you deleted “android.json” when you ran this command

```
$ cordova prepare android

```

it will create android.json again 😉

what i can see in your result, i think it’s error because your android sdk “/home/gama/applications/android-sdk-linux/”  
make sure you have latest update and do not forget to install ant

```
# brew update
# brew install ant

```

Here your missing directory “/home/gama/applications/android-sdk-linux/build-tools/19.1.0/aapt”  
by the way i am using latest version, try to install the latest version first. open up your android sdk manager and install latest build-tools or just update.

```
# android

```

 ![image](https://global.discourse-cdn.com/ionicframework/original/2X/3/35d4220e34cea49a80e0d804182ae355ee7eb312.png)

as you can see, just select which one of those Android SDK Build-Tools  
after you install it, check your “build-tools” directory

 ![image](https://global.discourse-cdn.com/ionicframework/original/2X/1/15fcd9cf13539bcb7ca3b81ffe0d3eb42a99c2f9.png)

it’s should be like those screen shot

Perhaps it’s work 😉
