I am just getting started with with Cordova ( PhoneGap ) and trying to build my first project with it, however I am running into a problem with my compilation step- when I try to build ( in tracking down the problem I broke down the build
step into prepare
and compile
and the former works fine as far as I know ) I see this:
~/Projects/MyProject$ cordova compile android
Compiling app on platform "android" via command "/media/glenatron/local disk/Projects/Cordova/MyProject/platforms/android/cordova/build"
{ [Error: spawn EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'spawn' }
Now from what I can tell this is a permissions problem, but having no Node or Cordova experience yet I am at a loss as to how to troubleshoot it. It looks as though it is trying to spawn another process - maybe the Android SDK? - and it is failing.
Is there a way I can ask Node or Cordova to give me more information on what is going on or is there a log file somewhere that will help me to track down what the problem is?
Edit: I realised cordova has a --verbose
switch and when I activated it I get the above output with an additional couple of lines...
Error: spawn EACCES
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
Unfortunately, they don't seem to actually give much more information, like which process it can't start.
For me, this has fixed it:
chmod 777 /Applications/Android\ Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle
It's a permission issue, just execute:
chmod 777 "/media/glenatron/localdisk/Projects/Cordova/MyProject/platforms/android/cordova/build"
That should fix the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With