Cordova - 命令的错误代码1命令失败 [英] Cordova - Error code 1 for command | Command failed for
问题描述
我是cordova的新人,所以如果我的问题不相关,请原谅我。
我有一个cordova项目在我的Windows 7 x64机器。
昨天我通过 cordova build android --release
构建我的cordova应用程序。
但是我需要添加新插件 cordova-plugin-zip
更新我的cordova项目。
我把我的插件添加到我的cordova应用程序;
I'm new on cordova, so if my question is not relevant, forgive me.
i have a cordova project in my Windows 7 x64 machine.
Yesterday i was build my cordova app via cordova build android --release
.
But i need to add new plugin cordova-plugin-zip
to update my cordova project.
What i did to add this plugin to my cordova app;
- 我安装了一个git应用程序到我的win7 x64 env。 / li>
-
npm install -g git
我在cmd上写了这个命令。 - 变量/路径窗口并添加
; C:\Program文件(x86)\Git\bin; C:\Program文件(x86)\Git\cmd
- 通过此命令添加插件
cordova插件添加https://github.com/apache/cordova-plugin-file.git
- 然后添加了其他插件
cordova插件添加https://github.com/MobileChromeApps/zip.git
(一切都很好,直到这一步) - 然后我运行cmd
cordova build android --release
- I installed a git application to my win7 x64 env.
npm install -g git
i wrote this command on cmd.- I Opened Windows Environment Variables/Path Window and added
;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
- add plugin via this command
cordova plugin add https://github.com/apache/cordova-plugin-file.git
- then added other plugin
cordova plugin add https://github.com/MobileChromeApps/zip.git
(Everything fine till this step) - Then i run on cmd
cordova build android --release
不幸的是,它会引发以下错误:
Unfourtunately it throws following error;
BUILD FAILED C:\android\sdk\tools\ant\build.xml:720:执行此行时发生以下
错误:
C:\android\sdk\ tools\ant\build.xml:734:编译失败;
BUILD FAILED C:\android\sdk\tools\ant\build.xml:720: The following error occurred while execu ting this line: C:\android\sdk\tools\ant\build.xml:734: Compile failed; see the compiler error o utput for details.
总时间:7秒
\hascevher\platforms\android\cordova\\\
ode_modules\q\q.js:126
throw e;
^命令的错误代码1:cmd with args:/ s,/ c,ant,release,-f,C:\ hascevher \platf
orms\android\build.xml, -Dout.dir = ant-build,-Dgen.absolute.dir = ant -gen
构建平台之一的错误:错误:cmd:命令失败,
退出代码1
C:\hascevher\platforms\android\cordova\node_modules\q\q.js:126 throw e; ^ Error code 1 for command: cmd with args: /s,/c,ant,release,-f,C:\hascevher\platf orms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
您可能没有构建此项目所需的环境或操作系统
错误:cmd:命令失败,退出代码1
在ChildProcess.whenDone(C:\Users \Hddn\AppData\Roaming\\\
pm\\\
ode_modules\cor
dova\\\
ode_modules\cordova-lib\src\cordova\superspawn.js:134:23)
在ChildCrocess.emit(events.js:110:17)
at maybeClose(child_process.js:1015:16)
在Process.ChildProcess._handle.onexit(child_process.js:1087:5)
You may not have the required environment or OS to build this project Error: cmd: Command failed with exit code 1 at ChildProcess.whenDone (C:\Users\Hddn\AppData\Roaming\npm\node_modules\cor dova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
当我尝试创建一个新的helloworld cordova项目并添加android平台然后从cmd cordova build android
它会创建示例应用程序吗?
When i try to create a new helloworld cordova project and adding android platform then from cmd cordova build android
it creates sample app?
那么我的其他应用程序有什么问题?
So what is wrong with my other application?
- 操作系统:Windows 7 x64
- Cordova v 5.1.1
- Ant版本1.9.4
Plugins On Cordova项目:
Plugins On Cordova Project:
- cordova插件文件
- cordova-plugin-zip
- org.apache.cordova.console
- org.apache.cordova.device
- org.apache.cordova.inappbrowser
- cordova-plugin-file
- cordova-plugin-zip
- org.apache.cordova.console
- org.apache.cordova.device
- org.apache.cordova.inappbrowser
完整的Windows环境变数/ / p>
Full Windows Environment Variables/Path:
C:\ProgramData\Oracle\Java\javapath; C:\Program Files\Common
\Microsoft Shared \Windows Live; C:\Program Files(x86)\Common
Files \Microsoft Shared \Windows
Live;%C_EM64T_REDIST11%bin \Intel64;%SystemRoot% \ system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; C:\Program
文件(x86)\ ATI Technologies \ATI.ACE\Core-Static; C:\Program文件
(x86)\Windows Live \Shared; C:\Program文件
(x86)\QuickTime \QTSystem\; C:\Program Files
(x86)\Java\jdk1.7.0_75\bin; C:\cordova \apache-ant-1.9.4\bin; C:\android\sdk\tools; C:\android \sdk\platform-tools; C:\Program
Files\\\
odejs\; C:\Program Files(x86 )\Git\bin; C:\Program Files
(x86)\Git\cmd
C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%C_EM64T_REDIST11%bin\Intel64;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Java\jdk1.7.0_75\bin;C:\cordova\apache-ant-1.9.4\bin;C:\android\sdk\tools;C:\android\sdk\platform-tools;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
推荐答案
我自己找到答案;
- 将NodeJ降级到0.10.36 >
- 升级Android SDK 22
- Downgrade NodeJs to 0.10.36
- Upgrade Android SDK 22
这篇关于Cordova - 命令的错误代码1命令失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!