简体   繁体   English

Cordova-CLI和PhoneGap-CLI没有看到android sdk

[英]Cordova-CLI & PhoneGap-CLI do not see android sdk

I've created app with " phonegap create " command. 我用“ phonegap create ”命令创建了应用程序。 Then I switch to project dir and try to run it with " phonegap local run android " and I have next error message: 然后我切换到项目目录并尝试使用“ phonegap local run android ”运行它,我有下一条错误消息:

Please install Android target 17 <...> 请安装Android目标17 <...>

Android SDK is placed to C:\\dev\\sdk My PATH variable contains C:\\dev\\sdk; C:\\div\\sdk\\platforms\\;C:\\dev\\sdk\\platform-tools Android SDK放置在C:\\ dev \\ sdk我的PATH变量包含C:\\dev\\sdk; C:\\div\\sdk\\platforms\\;C:\\dev\\sdk\\platform-tools C:\\dev\\sdk; C:\\div\\sdk\\platforms\\;C:\\dev\\sdk\\platform-tools I run " android " command from cmd and SDK Manager shows no updates or no missed sdk files. C:\\dev\\sdk; C:\\div\\sdk\\platforms\\;C:\\dev\\sdk\\platform-tools我从cmd运行“ android ”命令,SDK Manager显示没有更新或没有错过的sdk文件。 I tried create and run project with cordova cli but had same problem. 我尝试使用cordova cli创建并运行项目,但遇到了同样的问题。 What can it be? 它能是什么?

It seems that for latest Cordova (3.0.6), 似乎对于最新的Cordova(3.0.6),

cordova platform add android

command only recognize Android 4.2.2(API17) SDK. 命令仅识别Android 4.2.2(API17)SDK。 After I install the API17 SDK, the error was gone. 安装API17 SDK后,错误消失了。 Not sure if there is a cordova command option that can specify SDK version. 不确定是否有可以指定SDK版本的cordova命令选项。

I had just the same problem (error message) with os x (10.8). 我有与os x(10.8)相同的问题(错误消息)。 After executing the command android in the Terminal some android-packet-management-UI popped up. 在终端执行命令android ,弹出一些android-packet-management-UI。 There i could install stuff that made it run .. 在那里我可以安装让它运行的东西..

I had API17 installed but was still getting this error. 我安装了API17,但仍然收到此错误。

I needed to install apache-ant , set ANT_HOME=C:\\Program Files\\Java\\apache-ant\\ , JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_21\\ and add both bin's to my PATH += C:\\Program Files\\Java\\jdk1.7.0_21\\bin;C:\\Program Files\\Java\\apache-ant\\bin 我需要安装apache-ant ,设置ANT_HOME=C:\\Program Files\\Java\\apache-ant\\JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_21\\并将两个bin添加到我的PATH + = C:\\Program Files\\Java\\jdk1.7.0_21\\bin;C:\\Program Files\\Java\\apache-ant\\bin

See https://stackoverflow.com/a/13986997/956397 请参阅https://stackoverflow.com/a/13986997/956397

我有同样的问题,解决它的最简单的方法是将project.properties中的目标更改为16并尝试。

it seems if you type "android" at the same command prompt you type your cordova commands, you get a separate Android SDK manager then the one launched via Eclipse and so then there you select the appropriate packages and updates to achieve the version number of the Adroid SDK required. 看来如果你在同一个命令提示符下键入“android”,你输入你的cordova命令,你得到一个单独的Android SDK管理器,然后通过Eclipse启动,然后在那里你选择适当的包和更新来实现版本号的需要Adroid SDK。 For me I'm guessing it's from an adt-bundle I installed with _ ? 对我来说,我猜它来自我用_安装的adt-bundle? (I don't know actually no clue) that runs instead. (我不知道实际上没有线索)而是运行。 My best guess is the installer when updating doesn't doesn't update the path correctly. 我最好的猜测是更新时安装程序没有正确更新路径。

Ya you need to manually correct duplicates and anomalies in the path. 你需要手动纠正路径中的重复和异常。 Point to the "sdk" folder and tools of a valid most current adt-bundle-windows folder. 指向有效的最新adt-bundle-windows文件夹的“sdk”文件夹和工具。 Maybe it was NetBeans that did this? 也许是NetBeans做到了这一点? No it seems plausible when I put an update of Eclipse (C:\\Library\\Dev\\Android\\adt-bundle-windows-*) I must have not realized I needed to update the path too having done it manually the first time to get it to work. 当我更新Eclipse(C:\\ Library \\ Dev \\ Android \\ adt-bundle-windows- *)时看起来似乎不合理我一定没有意识到我需要更新路径也是第一次手动完成它它工作。

It seems I needed plateform-tools added as well for adb to run the emulate command... 似乎我需要为adb添加plateform-tools以运行模拟命令...

C:\\Library\\Dev\\Android\\adt-bundle-windows-x86_64-20131030\\sdk;C:\\Library\\Dev\\Android\\adt-bundle-windows-x86_64-20131030\\sdk\\tools;C:\\Library\\Dev\\Android\\adt-bundle-windows-x86_64-20131030\\sdk\\platform-tools; C:\\库\\开发\\的Android \\ ADT-束 - 窗口x86_64-20131030 \\ SDK; C:\\库\\开发\\的Android \\ ADT-束 - 窗口x86_64-20131030 \\ SDK \\工具; C:\\库\\开发\\的Android \\ ADT-束 - 窗口x86_64-20131030 \\ SDK \\平台的工具;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM