1
votes

E:\Document\Cordova\cord5>cordova platform add android

Creating android project... Error: cmd: Command failed with exit code ENOENT at ChildProcess.whenDone (C:\Users\jitendra\AppData\Roaming\npm\node_modules\cordova\src\superspawn.js:112:23) at ChildProcess.EventEmitter.emit (events.js:95:17) at Process.ChildProcess._handle.onexit (child_process.js:795:12)

I have checked JAVA_HOME,ANT_HOME,ANDROID_HOME,NODE_HOME environment variables which are fine.I made sure of setting android tools and perfom-tools in env variables as well.I have extensively googled it but none of the solution had worked for me..

Can anybody please help me??

Thank you Jitendra

1
try to run %userprofile%\.cordova\lib\android\cordova\3.3.0\bin\check_reqs.bat (replace 3.3.0 with 3.4.0 if you're using cordova 3.4) in a cmd window an let us know what it displays. Or add the -d arg to have more info : cordova -d platform add androidQuickFix
E:\actiworks\Cordova\cord7>%userprofile%\.cordova\lib\android\cordova\3.4.0\bin\check_reqs.bat [Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.]jitendra
But ant is installed successfully E:\actiworks\Cordova\cord7>ant -version Apache Ant(TM) version 1.9.3 compiled on December 23 2013jitendra
Well that's very strange, check_reqs launches ant -version and should display the message you have only if it fails. You can check the code in the file %userprofile%\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js, in the block module.exports.check_ant to see what it does in 3.4 (I am still in 3.3). You can try to patch the file to call d.resolve(); in all cases (skip the test).QuickFix
I am also facing the same issuePiyush Kashyap

1 Answers

0
votes

Check that both the Android SDK is installed and that both the tools and platform-tools folders are in your PATH.

In my case, those paths are:

C:\Users\moryl\AppData\Local\Android\android-sdk\tools

C:\Users\moryl\AppData\Local\Android\android-sdk\platform-tools

Go to a command prompt and run the "path" command to see your executable path. Edit the system path in the "System Properties" control panel applet by clicking on the "Advanced" link in the left hand column, then "Environment Variables" button at the bottom of the "Advanced" tab. Slightly easier to get to by just typing "environment" in the Start menu search text box.

Hope that helps.