foothill
foothill

Reputation: 483

Cordova platform add android fails

~/PhoneGap/app-hello-world$ cordova platform add android
[Error: An error occured during creation of android sub-project.  
/home/jj/.cordova/lib/android/cordova/3.0.0/bin/create: line 104: ant: command not
found
An unexpected error occurred: ant jar > /dev/null exited with 127
Deleting project...
]

After creating a cordova project i tried to add android to the platform but fails like this. I do have sdk tools and platform-tools exposed in my PATH, so if I type android on terminal it opens sdk manager.

For more information, I installed cordova through sudo npm install -g cordova, and got an warning message saying:

/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/couch-login
requires request@'~2.9.202' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/request,
npm WARN unmet dependency which is version 2.21.0

Any type of help will be greatly appreciated.

Upvotes: 0

Views: 10220

Answers (2)

Yuli Reiri
Yuli Reiri

Reputation: 591

Had the same problem. Solved by installing ant.

Upvotes: 4

obimod
obimod

Reputation: 797

Perhaps try the following:

  1. Upgrade JAVA / Reinstall JAVA / Make sure ant is there
  2. Follow the Cordove Android Platform Guide to make sure you have the SDK correctly installed on your machine

Upvotes: 0

Related Questions