title: Phonegap Error: "An error occurred while listing Android targets" while installing Phonegap on Ubuntu
body: <p><a href="http://cordova.apache.org/docs/en/3.3.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide" rel="nofollow noreferrer">http://cordova.apache.org/docs/en/3.3.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide</a></p>
  
  <p>As metioned in the above doc, I have already installed the required software for Phonegap as I have getting versions:</p>
  
  <p>For Java:</p>
  
  <blockquote>
  <pre><code>$ java -version java version "1.7.0_51" Java(TM) SE Runtime
  </code></pre>
    
    <p>Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM<br>
    (build 24.51-b03, mixed mode)</p>
  </blockquote>
  
  <p>For ANT</p>
  
  <blockquote>
  <pre><code>$ ant -version
  </code></pre>
    
    <p>Apache Ant(TM) version 1.8.2 compiled on December 3<br>
    2011</p>
  </blockquote>
  
  <p>For Node.JS</p>
  
  <blockquote>
  <pre><code>$ npm -version
  </code></pre>
    
    <p>1.4.3</p>
  </blockquote>
  
  <p>Now, the problem is when I create a phonegap project for Android like this "$ cordova create hello com.example.hello HelloWorld", it creates the project directory with "hello" name.</p>
  
  <p>But now, when I enter this command "$ cordova platform add android" in "hello" directory, it gives me the error given below:</p>
  
  <blockquote>
    <p>/hello$ cordova platform add android Creating android project...</p>
    
    <p>/home/deep/.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 /home/deep/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
        at _rejected (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
        at /home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
        at Promise.when (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
        at Promise.promise.promiseDispatch (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
        at /home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
        at flush (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
        at process._tickCallback (node.js:415:13) Error: /home/deep/.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)</p>
  </blockquote>
  
  <p>How to get out of this problem?</p>