Kirill Fuchs
Kirill Fuchs

Reputation: 13696

Error trying to add android platform to Cordova

I'm running on ubuntu 13.10 and I've installed cordova using npm(if that makes a difference). When I create a project and then try to run cordova platform add android I get the following Error:

/home/user/.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 added to your path.
    at /home/user/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:47:27
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)
Error: /home/user/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/src/superspawn.js:112: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)

Upvotes: 2

Views: 877

Answers (1)

Kirill Fuchs
Kirill Fuchs

Reputation: 13696

You need to install ANT.

You can do so by running the command sudo apt-get install ant

Another common issue: The android sdk platform-tools and tools dir both have to be within your $PATH

Your implementation may vary but something along the lines of:

export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools

source ~/.bash_profile

see: Android Platform Guide

Upvotes: 5

Related Questions