0

when i try to add platform by this command cordova platform add android i got the below error

i search a lot and try every possible solution but could not fix this ANT error

please provide me some suggestion how do i fix it.

C:\Users\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 126
                    throw e;
                          ^ Error: ERROR : executing command 'ant', make sure you have ant installed and add ed to your path.
    at C:\Users\.cordova\lib\android\cordova\3.4.0\bin\lib\check_req s.js:47:27
    at exithandler (child_process.js:633:7)
    at ChildProcess.errorhandler (child_process.js:649:5)
    at ChildProcess.EventEmitter.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:795:12) Error: C:\Users\.cordova\lib\android\cordova\3.4.0\bin\create.bat: C ommand failed with exit code 8
    at ChildProcess.whenDone (C:\Users\AppData\Roaming\npm\node_modu les\cordova\src\superspawn.js:126:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Arun
  • 257
  • 1
  • 5
  • 22
  • explain a little more what you tried if you expect any help. have you checked ant is installed, in the path and working? – QuickFix Apr 17 '14 at 12:57
  • @QuickFix yes ant is installed when i check ant -v i got following result Apache Ant(TM) version 1.9.3 compiled on December 23 2013 Trying the default build file: build.xml Buildfile: build.xml does not exist! Build failed – Arun Apr 17 '14 at 12:59
  • possible duplicate of [Cordova 3.4.0-0.1.3 adding android platform Error](http://stackoverflow.com/questions/22928626/cordova-3-4-0-0-1-3-adding-android-platform-error) – ChenSmile Apr 17 '14 at 13:02
  • @ImranKhan i have already visit this link but could not fix my errors – Arun Apr 17 '14 at 13:04
  • @ArunMaddheshia what is the error, where u r facing error – ChenSmile Apr 17 '14 at 13:11
  • @ImranKhan when i try to run this cordova platforms add android thre is following error ... Error: ERROR : executing command 'ant', make sure you have ant installed and add ed to your path. – Arun Apr 17 '14 at 13:14
  • Try this http://stackoverflow.com/a/19495611/2522603 – ChenSmile Apr 17 '14 at 13:16

1 Answers1

0

You need to install Apache ANT on your system and set the ant path in your system environment variables. Set the below options in the user variables.

ANT_HOME  C:\apache-ant-1.8.2

Path ;C:\apache-ant-1.8.2\bin

Replace C:\apache-ant-1.8.2 with the ant installation path on your system. And you need add ;C:\apache-ant-1.8.2\bin to your path. Don't replace it.

kiran
  • 2,280
  • 2
  • 23
  • 30