Cordova android 构建立即失败 [错误:产生 EACCES] [英] Cordova android build fails immediately [Error: spawn EACCES]
问题描述
我刚刚开始使用 Cordova(PhoneGap)并尝试用它构建我的第一个项目,但是我的编译步骤遇到了问题 - 当我尝试构建时(在跟踪问题时我崩溃了build
步骤进入 prepare
和 compile
,据我所知,前者工作正常)我看到了:
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' }
据我所知,这是一个权限问题,但没有 Node 或 Cordova 经验,我不知道如何解决它.看起来好像它正在尝试生成另一个进程 - 也许是 Android SDK?- 它正在失败.
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.
有没有办法让 Node 或 Cordova 给我更多关于正在发生的事情的信息,或者是否有日志文件可以帮助我追踪问题所在?
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?
我意识到cordova有一个--verbose
开关,当我激活它时,我得到了上面几行的输出......
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.
推荐答案
权限问题,直接执行:
chmod 777 "/media/glenatron/localdisk/Projects/Cordova/MyProject/platforms/android/cordova/build"
那应该可以解决问题.
这篇关于Cordova android 构建立即失败 [错误:产生 EACCES]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!