Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Android to Phonegap Platforms version 3

After much digging, i believe that this problem is related to me not having any platforms added for phonegap to build from. This is missing from their documentation.

When i trying to add a platofrm phonegap

Running code

C:\var\www\sexdiaries.co.uk\sexdiaries>phonegap platform add andriod
   [error] 'platform add andriod' is not a node C:\Users\Hutber\AppData\Roaming\npm\node_m
 See 'node C:\Users\Hutber\AppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js help'

Platforms

Platforms:

  keyword            | local environment | remote environment
  -------------------|-------------------|-------------------
  android            | ?                 | ?
  blackberry         | ? (BlackBerry 10) | ? (BlackBerry 6)
  ios                | ?                 | ?
  symbian            | ?                 | ?
  webos              | ?                 | ?
  wp7                | ?                 | ?
  wp8                | ?                 | ?
like image 546
Jamie Hutber Avatar asked Aug 24 '13 22:08

Jamie Hutber


3 Answers

For some reason, you can't add platforms in an obvious way so i found this:

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

Command

   phonegap build android

build

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.

like image 200
Jamie Hutber Avatar answered Nov 12 '22 06:11

Jamie Hutber


your command is like this "phonegap platform add andriod"

But it is android, not andriod

you need to change andriod to android.

like image 41
Paulo Cella Avatar answered Nov 12 '22 05:11

Paulo Cella


For anyone else still having problems, I found that using the run command works as well.

like image 1
Brian Avatar answered Nov 12 '22 05:11

Brian