0

I'm trying to get Phonegap to work on Ubuntu 12.04. So far I've successfully (well kind of) installed it using this guide: http://perrymitchell.net/article/install_phonegap_ubuntu_12.04

I've also added the android sdk and the PATH vars.

The "phonegap create" command was successful, however when running the "phonegap run android" or the "phonegap build android" the following occurs:

rok@localhost:~/myapp$ phonegap run android
[phonegap] detecting Android SDK environment...
[phonegap] using the remote environment

/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/common/config/global.js:45
    fs.exists(filepath, function(exists) {
       ^
TypeError: Object #<Object> has no method 'exists'
    at Object.load (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/common/config/global.js:45:8)
    at PhoneGapBuild.<anonymous> (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/phonegap-build/login.js:60:19)
    at PhoneGapBuild.login (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/phonegap-build/login.js:47:13)
    at PhoneGapBuild.<anonymous> (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/phonegap-build/build.js:60:10)
    at PhoneGapBuild.build (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/phonegap-build/build.js:40:13)
    at RemoteBuildCommand.execute (/usr/local/lib/node_modules/phonegap/lib/phonegap/remote.build.js:74:19)
    at RemoteBuildCommand.run (/usr/local/lib/node_modules/phonegap/lib/phonegap/remote.build.js:54:10)
    at Object.build (/usr/local/lib/node_modules/phonegap/lib/phonegap/util/command.js:28:25)
    at RemoteRunCommand.execute (/usr/local/lib/node_modules/phonegap/lib/phonegap/remote.run.js:71:26)
    at RemoteRunCommand.run (/usr/local/lib/node_modules/phonegap/lib/phonegap/remote.run.js:54:10)

Trying to run this was not successful either:

rok@localhost:~/myapp$ phonegap local plugin add org.apache.cordova.core.console
[phonegap] adding the plugin: org.apache.cordova.core.console
   [error] Error fetching plugin: Error: connect ECONNREFUSED

What am I doing wrong

Rok
  • 1,482
  • 3
  • 18
  • 37

1 Answers1

2

To answer my own question, before one can successfully run a hello world app using phonegap, two more things need to be done (not just on Ubuntu 12.04 but I assume on any platform):

  1. run "android" command from the CLI and download at least one version of the SDK
  2. run "android avd" command and create at least one virtual device based on a version of a previously downloaded SDK.

Then I was able to run "phonegap run android" on the little hello app described on the PhoneGap's website.

Rok
  • 1,482
  • 3
  • 18
  • 37