简体   繁体   English

做Cordova平台时出错,在Cordova 3.3中添加了android

[英]Error doing cordova platform add android in cordova 3.3

I'm using cordova 3.3.0 on Windows in cygwin, and I'm getting the following error when I try to add the android platform 我在cygwin的Windows上使用的是cordova 3.3.0,当我尝试添加android平台时出现以下错误

Error: An error occured during creation of android sub-project. 

C:\Users\Mike\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:126
                throw e;
                      ^
Please install Android target 19 (the Android newest SDK). Make sure you have the latest Android tools installed as well. Run "android" from your command-line to install/update any missing SDKs or tools.

I have the latest available versions or java, ant and the android sdk api 19 installed, as well as the latest android tools, platform-tools and build-tools but the error persists. 我安装了最新的可用版本或java,ant和android sdk api 19,以及最新的android工具,平台工具和构建工具,但错误仍然存​​在。 (I tried to post an image of my SDK Manager to show this but I don't have enough reputation :( (我试图发布我的SDK Manager的图像来显示此图像,但我的信誉不高:(

The end of my PATH variable contains the correct locations for android tools and platform-tools as suggested here 我的PATH变量的末尾包含此处建议的android工具和platform-tools的正确位置

....:/cygdrive/c/Users/Mike/bin:/cygdrive/c/Tools/apache-ant-1.9.3/bin:/cygdrive/c/Tools/sdk/platform-tools:/cygdrive/c/Tools/sdk/tools:/cygdrive/c/Program Files/Java/jdk1.7.0_51/jre/bin

The strange thing is that my project used to build correctly, but then stopped working when nothing noticeable had changed. 奇怪的是,我的项目以前可以正确构建,但是在没有明显变化的情况下停止工作。 I've fixed this before by building a new cordova project, but now I get this error with a brand new HelloWorld cordova project: 我之前通过构建新的cordova项目来解决此问题,但是现在我使用全新的HelloWorld cordova项目遇到此错误:

Mike@Mike-VAIO /cygdrive/c/workspaces/apps
$ cordova create test com.example.test HelloWorld
Creating a new cordova project with name "HelloWorld" and id "com.example.test" at location "C:\workspaces\apps\test"

Mike@Mike-VAIO /cygdrive/c/workspaces/apps
$ cd test

Mike@Mike-VAIO /cygdrive/c/workspaces/apps/test
$ cordova platform add android
Creating android project...
Error: An error occured during creation of android sub-project. 

C:\Users\Mike\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:126
                    throw e;
                          ^
Error: Please install Android target 19 (the Android newest SDK). Make sure you have the latest Android tools installed as well. Run "android" from your command-line to install/update any missing SDKs or tools.

I've tried reinstalling cordova but that doesn't help. 我尝试重新安装cordova,但这无济于事。 Does anyone have any other ideas? 还有其他想法吗?

many thanks in advance 提前谢谢了

You should check if Target 19 really exists. 您应该检查目标19是否确实存在。 Go to your android SDK folder, then to platforms and check if there is a folder called android-19. 转到您的android SDK文件夹,然后转到平台并检查是否存在名为android-19的文件夹。

But still this looks like cordova is not able to point out your android SDK folder or your target 19 folder. 但这仍然看起来cordova无法指出您的android SDK文件夹或目标19文件夹。

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

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