# Ionic build android not working

**URL:** <https://forum.ionicframework.com/t/ionic-build-android-not-working/7095>\
**Category:** ionic-v1\
**Created:** [July 20, 2014, 1:08pm UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095 "2014-07-20T13:08:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![quertun](https://avatars.discourse-cdn.com/v4/letter/q/85e7bf/32.png) [@quertun](https://forum.ionicframework.com/u/quertun)\
**Post date:** [July 20, 2014, 1:08pm UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/1 "2014-07-20T13:08:02Z")

</div>

Hey everyone,

While trying to build the example app tabs.  
I get the following error

> quertun@N750JV:/media/quertun/DATA/Dev/IonicProjects/myApp$ ionic build androidBuilding platform android  
> Running command: /media/quertun/DATA/Dev/IonicProjects/myApp/platforms/android/cordova/build  
> execvp(): Permission denied  
> Error: /media/quertun/DATA/Dev/IonicProjects/myApp/platforms/android/cordova/build: Command failed with exit code EACCES  
> at ChildProcess.whenDone (/usr/local/lib/node\_modules/cordova/node\_modules/cordova-lib/src/cordova/superspawn.js:135:23)  
> at ChildProcess.EventEmitter.emit (events.js:95:17)  
> at Process.ChildProcess.\_handle.onexit (child\_process.js:795:12)  
> Unable to build app on platform android. Please see console for more info.

I think something somewhere doesn’t have the permission to be executed.  
Running Ubuntu 14.04

java -version

> java version “1.7.0\_55”  
> OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1)  
> OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)

ant -version

> Apache Ant™ version 1.9.3 compiled on April 8 2014

JAVA\_HOME and ANT\_HOME are set

> /usr/lib/jvm/java-7-openjdk-amd64/jre  
> /usr/share/ant

platform-tools and tools directories are in PATH env.  
Even chmod 777 -R java ant adt dirs

And I have no idea where to look now. Can somebody please point me in the right direction

---

<div class="post-metadata">

**Author:** ![matheusrocha89](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/matheusrocha89/32/7980_2.png) [@matheusrocha89](https://forum.ionicframework.com/u/matheusrocha89)\
**Post date:** [July 20, 2014, 5:15pm UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/2 "2014-07-20T17:15:45Z")

</div>

The problem is that the platforms folder was created by admin user not your user, so you don’t have permission to write on it, so you can’t build, try to give permission to the {your\_project/platforms/} recursively (with -R).

Try:

```
sudo chmod 0777 -R {your_project_folder}/platforms/android/

```

If it was not that, I think probably you didn’t install ionic globally (with the -g on the npm command) It’s better to install it with this paremeter. Try the first solution and see if you can build, if you can’t try the second, install Ionic again globally.

---

<div class="post-metadata">

**Author:** ![quertun](https://avatars.discourse-cdn.com/v4/letter/q/85e7bf/32.png) [@quertun](https://forum.ionicframework.com/u/quertun)\
**Post date:** [July 21, 2014, 8:30am UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/3 "2014-07-21T08:30:42Z")

</div>

Thanks for the reply

The permissions on the project folder wasn’t the problem.  
Reinstalled ionic and cordova global. Which I thought I did in the first place.

Now I don’t get an error from cordova. It just says building platform and then unable to build platform check console blabla.  
But there is no error in the console.

After running the build command a second time I get the same error again.

---

<div class="post-metadata">

**Author:** ![matheusrocha89](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/matheusrocha89/32/7980_2.png) [@matheusrocha89](https://forum.ionicframework.com/u/matheusrocha89)\
**Post date:** [July 21, 2014, 12:52pm UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/4 "2014-07-21T12:52:03Z")

</div>

Try this, try to create a new project from blank…and try to build. Did you add the platforms do you want?

---

<div class="post-metadata">

**Author:** ![duall](https://avatars.discourse-cdn.com/v4/letter/d/278dde/32.png) [@duall](https://forum.ionicframework.com/u/duall)\
**Post date:** [July 21, 2014, 2:56pm UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/5 "2014-07-21T14:56:01Z")

</div>

`rm -rf platforms` then `cordova platform add android`  
and again `ionic build android`?

---

<div class="post-metadata">

**Author:** ![quertun](https://avatars.discourse-cdn.com/v4/letter/q/85e7bf/32.png) [@quertun](https://forum.ionicframework.com/u/quertun)\
**Post date:** [July 21, 2014, 4:27pm UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/6 "2014-07-21T16:27:45Z")

</div>

Thanks all for helping out

Finally I figured it out. The laptop I use for coding is a dualboot win8 xubuntu. And the partition I use for development is ntfs. So it is accessible by both os. I kinda forgot about it. Don’t use win anymore. But apparently I can’t set the right permissions on the drive. Figured it out when I did a chmod 0777 -v twice in a row and saw the permissions hadn’t changed.

Running the example app as I type in my home folder :))

---

<div class="post-metadata">

**Author:** ![ron1010](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@ron1010](https://forum.ionicframework.com/u/ron1010)\
**Post date:** [October 15, 2014, 2:04am UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/7 "2014-10-15T02:04:22Z")

</div>

i was getting a similar problem, could not ‘platform add android’ not working. The fix was to add the JDK bin directory to my path and not the JDK root directory.

---

<div class="post-metadata">

**Author:** ![germ13](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/germ13/32/65021_2.png) [@germ13](https://forum.ionicframework.com/u/germ13)\
**Post date:** [March 18, 2015, 8:25am UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/8 "2015-03-18T08:25:40Z")

</div>

@matheusrocha89 I second that. Same issue here. My code resides in an ntfs drive, and coding from Ubuntu. Still trying to figure a workaround though. Any luck? I don’t want to stop using my ntfs drive.

---

<div class="post-metadata">

**Author:** ![matheusrocha89](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/matheusrocha89/32/7980_2.png) [@matheusrocha89](https://forum.ionicframework.com/u/matheusrocha89)\
**Post date:** [March 18, 2015, 12:09pm UTC](https://forum.ionicframework.com/t/ionic-build-android-not-working/7095/9 "2015-03-18T12:09:44Z")

</div>

Try to change the permission of the folder using `sudo chmod`
