HddnTHA HddnTHA - 1 year ago 297
Node.js Question

Cordova - Error code 1 for command | Command failed for

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
to update my cordova project.
What i did to add this plugin to my cordova app;

  • 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: 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.

Total time: 7 seconds

throw e;
^ Error code 1 for command: cmd with args: /s,/c,ant,release,-f,C:\hascevher\platf
ERROR building one of the platforms: Error: cmd: Command failed with
exit code 1

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
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

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?

Any help greatly appricated.

  • OS: Windows 7 x64

  • Cordova v 5.1.1

  • Ant version 1.9.4

Plugins On Cordova Project:

  • cordova-plugin-file

  • cordova-plugin-zip

  • org.apache.cordova.console

  • org.apache.cordova.device

  • org.apache.cordova.inappbrowser

Full Windows Environment Variables/Path:

C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common
Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common
Files\Microsoft Shared\Windows
Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files
(x86)\Windows Live\Shared;C:\Program Files
(x86)\QuickTime\QTSystem\;C:\Program Files
Files\nodejs\;C:\Program Files (x86)\Git\bin;C:\Program Files

Answer Source

I found answer myself; and if someone will face same issue, i hope my solution will work for them as well.

  • Downgrade NodeJs to 0.10.36
  • Upgrade Android SDK 22
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download