Ionic build android not working

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

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.

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.

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

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

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 :))

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.

@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.

Try to change the permission of the folder using sudo chmod