在列出 Android 目标时,cordova 平台添加 android 不起作用 [英] cordova platform add android not working while listing Android targets

查看:40
本文介绍了在列出 Android 目标时,cordova 平台添加 android 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 phoneGap 应用程序中添加一个 android 平台时遇到问题.当我执行命令 cordova platform add android 时,我在 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 目标时发生错误)

我已经尝试在路径变量中添加我的 android sdk 位置.

I already try to add my android sdk location in the path variable.

请帮帮我!:D

我在 Windows 7 64 位上工作,我使用 android SDK 安装了 android API 17、18 和 19.我使用的是 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.

推荐答案

要工作,此cordova 命令需要使用位于sdk/tools 目录中的一些程序.您还需要安装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 SDKc:sdkandroid 目录
  • 您已将 Apache ant 安装到 c: oolsapache-ant 目录
  • let's assume you have installed your Android SDK to the c:sdkandroid directory
  • you have installed you Apache ant to the c: oolsapache-ant directory

那么你必须创建两个系统变量:

Then you must create two system variables:

  1. ANDROID_HOME 带有 c:sdkandroid
  2. ANT_HOME 带有 c: oolsapache-ant
  1. ANDROID_HOME with the c:sdkandroid value
  2. ANT_HOME with the c: oolsapache-ant value

最后,您必须修改 PATH 变量并将这两个添加到 PATH' 值的末尾:

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

;%PATH%	ools;%ANT_HOME%in;%ANDROID_HOME%	ools;%ANDROID_HOME%platform-tools

注意:对于使用 Linux 的用户,说明略有不同.

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

更多文档可用此处.

这篇关于在列出 Android 目标时,cordova 平台添加 android 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆