title: Cordova, getting Error while adding android platform on Ubuntu 14.04
body: <p>I installed cordova and can create a new project without any problems.</p>
  
  <p>However I'm getting the following error when trying to add android platform:</p>
  
  <pre><code>sudo cordova platform add android
  Running platform task...
  Adding platform android
  Creating android project...
  
  /home/tushar/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:126
                      throw e;
                            ^
  Error: An error occurred while listing Android targets
      at /home/tushar/.cordova/lib/android/cordova/3.5.0/bin/lib/check_reqs.js:87:29
      at _rejected (/home/tushar/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:808:24)
      at /home/tushar/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:834:30
      at Promise.when (/home/tushar/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:1079:31)
      at Promise.promise.promiseDispatch (/home/tushar/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:752:41)
      at /home/tushar/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:574:44
      at flush (/home/tushar/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:108:17)
      at process._tickCallback (node.js:415:13)
  Error: /home/tushar/.cordova/lib/android/cordova/3.5.0/bin/create: Command failed with exit code 8
      at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131: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)
  Unable to add platform android. Please see console for more info.
  </code></pre>
  
  <p>I have <strong>tried almost all of the solutions from stackoverflow</strong> but none of them solved. 
  I have added the path to android sdk, ant etc on ./bashrc file as following:</p>
  
  <pre><code>export HOME="/home/tushar"
  export ANDROID_HOME="$HOME/Development/adt-bundle/sdk/tools"
  export ANDROID_PLATFORM_TOOLS="$HOME/Development/adt-bundle/sdk/platform-tools"
  export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
  
  export ANT_HOME="$HOME/Development/ant"
  export PATH="$PATH:$ANT_HOME/bin"
  </code></pre>
  
  <p>But I am still getting the problem.</p>
  
  <p>Any Suggestions???</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>These might be helpful to debug:</p>
  
  <pre><code>$ node -v
  v0.10.25
  
  $ npm -v
  1.3.10
  
  $ cordova -v
  3.5.0-0.2.4
  
  $ android list targets
  Available Android targets:
  ----------
  id: 1 or "android-19"
       Name: Android 4.4.2
       Type: Platform
       API level: 19
       Revision: 3
       Skins: HVGA, WXGA800, WVGA800 (default), WQVGA432, WXGA800-7in, WXGA720, QVGA, WVGA854, WQVGA400, WSVGA
   Tag/ABIs : default/armeabi-v7a
  </code></pre>