1

It seems rather simple to me, but I can't do it at all.

I have npm install -g phonegap with everything successful and installing phonegap.

I have followed instructions from here http://phonegap.com/install/ i have then created my project:

C:\var\www\sexdiaries.co.uk>phonegap create sexdiaries -n SexDiaries -i co.uk.sexdiaries.app

I have then, as told Here tried to run andriod but with the following errors

C:\var\www\sexdiaries.co.uk\sexdiaries>phonegap run andriod

C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\run.js:72
    self.phonegap.emit('log', 'detecting', platform.human, 'SDK environment...
                                                   ^
TypeError: Cannot read property 'human' of undefined
    at RunCommand.execute (C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\run.js:72:52)
    at RunCommand.run (C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\run.js:55:10)
    at PhoneGap.run (C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\util\command.js:28:25)
    at CLI.module.exports [as run] (C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\lib\cli\run.js:38:14)
    at CLI.module.exports [as argv] (C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\lib\cli\argv.js:66:17)
    at Object.<anonymous> (C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js:24:21)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

More over, I have imported the project created into Andriod Studio, but when doing so I get: Source files for your project not found

I know how to create a working project using phonegap 2.9. But can't work out what 3 is offering?

So the question, how do I actually get a working local android app working using phoengap 3

Matt Whetton
  • 6,616
  • 5
  • 36
  • 57
Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291
  • 2
    Off-topic - but you might want to run the text on your web site through a spell checker ... – RenniePet Aug 25 '13 at 04:10
  • heh, i appreciate the concern, being dyslextic spelling is certainly not my strong point. But, I'm just waiting for my copywriter to give me something. I'm no copywriter thats for sure. – Jamie Hutber Aug 25 '13 at 09:22

3 Answers3

10

The command is 'phonegap run android', It is not 'phonegap run andriod'. Try it again. I had this problem like you.

user1772976
  • 131
  • 5
2

Upon must digging I found how to get past this:

phonegap run android

Its as simple as that.

[Edit]

You need to add platform to work with, whilst the documentation is so very very poor:

C:\var\www\sexdiaries.co.uk\sexdiaries>phonegap build android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
 [warning] missing library cordova/android/3.0.0
[phonegap] downloading https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.0.0;sf=tgz...
[phonegap] compiling Android...
[phonegap] successfully compiled Android app

Then you are good to go, doing an import with Andriod Studio will also work now as you have a project to work with :)

Fantastic.

Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291
2

I have used phonegap 3.0 with Android Studio and its working fine. Please go through this

Saro Taşciyan
  • 5,210
  • 5
  • 31
  • 50