title: cordova phonegap - error installing on Android platform
body: <p>I am new to Cordova and phonegap but have Android working on my ubuntu 12.04.
  I followed this <a href="http://docs.phonegap.com/en/3.4.0/guide_cli_index.md.html#The%20Command-Line%20Interface" rel="nofollow noreferrer">official guide</a> and manage to install cordova.</p>
  
  <p>Despite my machine supports android sdk, when I run this command:</p>
  
  <pre><code>cordova platform add android
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code> *cordova platform add android
  
   Creating android project...
   /root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126
                  throw e;
                        ^
  Error: An error occurred while listing Android targets
  at /root/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
  at _rejected (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
  at /root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
  at Promise.when    (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
  at Promise.promise.promiseDispatch (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
  at /root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
  at flush (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
  at process._tickCallback (node.js:415:13)
  Error: /root/.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)
  root@sergio-Aspire-5755G:/home/sergio/Development/HelloWorld#  cordova platforms ls
  Installed platforms: 
  Available platforms: android, blackberry10, firefoxos, ubuntu
  root@xxx-Aspire-5755G:/home/sergio/Development/HelloWorld# cordova platform add android
  Creating android project...
  /root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126
                  throw e;
                        ^
  Error: An error occurred while listing Android targets
  at /root/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
  at _rejected (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
  at /root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
  at Promise.when    (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
  at Promise.promise.promiseDispatch (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
  at /root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
  at flush (/root/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
  at process._tickCallback (node.js:415:13)
  Error: /root/.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)*
  </code></pre>
  
  <p>I tried and see other post like <a href="https://stackoverflow.com/questions/18894714/phonegap-ubuntu-12-04">this</a> but noone helped me.</p>
  
  <p>Android sdk version 19 is installed</p>