Question

I am trying to install cordova, I do excatly what is said in the CLI tutorial here. After creating a new App

cordova create hello com.example.hello HelloWorld

I list all platforms and see following: enter image description here Where is other platforms liks ios? Moreover, when I try

cordova platform add android

I get following error: enter image description here

What I am doing wrong or what is wrong with the Cordova?

Était-ce utile?

La solution

To work, this cordova command needs to use some programs located into your sdk/tools directory. You need also have installed apache ant.

Then you must add these directories into your PATH system variable:

Background:

  • let's assume you have installed your Android SDK to the c:\sdk\android directory
  • you have installed you Apache ant to the c:\tools\apache-ant directory

Then you must create two system variables:

  1. ANDROID_HOME with the c:\sdk\android value
  2. ANT_HOME with the c:\tools\apache-ant value

Finally, you must modify the PATH variable and add those two to the end of the PATH' value:

;%PATH%\tools;%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

NOTE: for those who uses Linux, the instruction differs a bit.

More documentation available here.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top