我有问题,当我想要一个Android平台添加到我的PhoneGap的应用程序。 我得到了我的CLI此消息时,我执行命令科尔多瓦平台添加机器人:
I got problem when i want to add an android platform to my phoneGap application. I got this message in my CLI when i execute the command cordova platform add android :
检查Android的要求...
(错误:同时列出Android的目标发生了错误)
Checking Android requirements...
(Error: An error occurred while listing Android targets)
我已经尝试添加路径变量我的Android SDK中的位置。
I already try to add my android sdk location in the path variable.
请帮帮我! :D
我工作在Windows 7 64位的,我安装Android的API 17,18和19的Android SDK。 我是3.2的PhoneGap版本。
I work on Windows 7 64 bits, i install the android API 17, 18 and 19 with the android SDK. I am on 3.2 phoneGap version.
要工作,这科尔多瓦命令需要使用一些程序设到 SDK /工具
目录。你还需要安装的 Apache Ant的
To work, this cordova command needs to use some programs located into your sdk/tools
directory. You need also have installed apache ant.
然后,你必须添加这些目录到 PATH
系统变量:
Then you must add these directories into your PATH
system variable:
背景:
让我们假设你已经安装了你的Android SDK 到 C:\ SDK \机器人
目录
您已经安装了您 Apache Ant的到 C:\工具\ Apache的蚂蚁
目录
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:
ANDROID_HOME
与 C:\ SDK \机器人
值
ANT_HOME
与 C:\工具\ Apache的蚂蚁
值
ANDROID_HOME
with the c:\sdk\android
value
ANT_HOME
with the c:\tools\apache-ant
value
最后,你必须修改 PATH
变量,并添加这两个到 PATH
值的结尾:
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
注意:对于那些谁使用Linux,指令还是有些不同。
NOTE: for those who uses Linux, the instruction differs a bit.
更多可用的文档here.