Cordova - 命令的错误代码 1 |命令失败 [英] Cordova - Error code 1 for command | Command failed for
问题描述
我是科尔多瓦的新手,所以如果我的问题不相关,请原谅我.我的 Windows 7 x64 机器中有一个cordova 项目.昨天我通过 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;
- 我在我的 win7 x64 环境中安装了一个 git 应用程序.
npm install -g git
我在 cmd 上写了这个命令.- 我打开Windows环境变量/路径窗口并添加
;C:Program Files (x86)Gitin;C:Program Files (x86)Gitcmd
- 通过这个命令添加插件
cordova plugin add 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)Gitin;C:Program Files (x86)Gitcmd
- 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;
构建失败 C:androidsdk oolsantuild.xml:720: 以下执行此行时发生错误:C:androidsdk oolsantuild.xml:734:编译失败;见编译器错误输出以了解详细信息.
BUILD FAILED C:androidsdk oolsantuild.xml:720: The following error occurred while execu ting this line: C:androidsdk oolsantuild.xml:734: Compile failed; see the compiler error o utput for details.
总时间:7 秒
C:hascevherplatformsandroidcordova ode_modulesqq.js:126扔e;^ 命令的错误代码 1:带有 args 的 cmd:/s,/c,ant,release,-f,C:hascevherplatformsandroiduild.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen错误构建平台之一:错误:cmd:命令失败退出代码 1
C:hascevherplatformsandroidcordova ode_modulesqq.js:126 throw e; ^ Error code 1 for command: cmd with args: /s,/c,ant,release,-f,C:hascevherplatf ormsandroiduild.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:UsersHddnAppDataRoaming pm ode_modulescordova ode_modulescordova-libsrccordovasuperspawn.js:134:23)在 ChildProcess.emit (events.js:110:17)在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:UsersHddnAppDataRoaming pm ode_modulescor dova ode_modulescordova-libsrccordovasuperspawn.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
Cordova 项目的插件:
Plugins On Cordova Project:
- cordova 插件文件
- cordova-plugin-zip
- org.apache.cordova.console
- org.apache.cordova.device
- org.apache.cordova.inappbrowser
完整的 Windows 环境变量/路径:
Full Windows Environment Variables/Path:
C:ProgramDataOracleJavajavapath;C:Program FilesCommonFilesMicrosoft SharedWindows Live;C:Program Files (x86)Common文件微软共享WindowsLive;%C_EM64T_REDIST11%binIntel64;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:Program文件 (x86)ATI TechnologiesATI.ACECore-Static;C:Program Files(x86)Windows LiveShared;C:Program Files(x86)QuickTimeQTSystem;C:Program Files(x86)Javajdk1.7.0_75in;C:cordovaapache-ant-1.9.4in;C:androidsdk ools;C:androidsdkplatform-tools;C:程序Files odejs;C:Program Files (x86)Gitin;C:Program Files(x86)Gitcmd
C:ProgramDataOracleJavajavapath;C:Program FilesCommon FilesMicrosoft SharedWindows Live;C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;%C_EM64T_REDIST11%binIntel64;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:Program Files (x86)ATI TechnologiesATI.ACECore-Static;C:Program Files (x86)Windows LiveShared;C:Program Files (x86)QuickTimeQTSystem;C:Program Files (x86)Javajdk1.7.0_75in;C:cordovaapache-ant-1.9.4in;C:androidsdk ools;C:androidsdkplatform-tools;C:Program Files odejs;C:Program Files (x86)Gitin;C:Program Files (x86)Gitcmd
推荐答案
我自己找到了答案;如果有人会遇到同样的问题,我希望我的解决方案也适用于他们.
I found answer myself; and if someone will face same issue, i hope my solution will work for them as well.
- 将 NodeJs 降级到 0.10.36
- 升级 Android SDK 22
这篇关于Cordova - 命令的错误代码 1 |命令失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!