同时列出Android的目标时出错 [英] An error occurred while listing Android targets
问题描述
我收到此相同的错误,而试图添加Android平台
来使用创建简单的HelloWorld应用程序 CLI科尔多瓦
上Windows 8的。
I am getting this same error while trying to add platform Android
to simple HelloWorld application created using CLI Cordova
on Windows 8.
路径vaiables已定
%ANT%,%ANT_HOME%,%ANDROID_HOME%
路径还包括
%ANDROID_HOME%\平台工具和%ANDROID_HOME%\工具的目录。
Path vaiables has been set for
%ANT%,%ANT_HOME%,%ANDROID_HOME%
PATH Also contains
%ANDROID_HOME%\platform-tools and %ANDROID_HOME%\tools in the listings.
PS E:\Android Projects\HelloWorld> cordova platforms add android
Creating android project...
C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:126
throw e;
^
Error: An error occurred while listing Android targets
at C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js:87:29
at _rejected (C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:808:24)
at C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:834:30
at Promise.when (C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:752:41)
at C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:574:44
at flush (C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
Error: C:\Users\MIGHTY\.cordova\lib\android\cordova\3.4.0\bin\create.bat: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\MIGHTY\AppData\Roaming\npm\node_modules\cordova\src\superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
呈三角错误正在试图在iOS创建相同的提高也。
Simillar error is being raised while trying to create the same on iOS also.
PS E:\Android Projects\HelloWorld> cordova platforms add ios
Creating ios project...
Error: C:\Users\MIGHTY\.cordova\lib\ios\cordova\3.4.1\bin\create: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Users\MIGHTY\AppData\Roaming\npm\node_modules\cordova\src\superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:795:12)
解决:
感谢您,的问题,Android已经得到解决。
路径变量指向这个机器人是错误的。我用的%ANDROID_HOME%作为变量,并调整同为路径变量的%ANDROID_HOME%\ SDK \工具。这种方法是行不通的。直接指向工具和平台工具实验解决了。
The path variable pointing to this android was wrong. I had used %ANDROID_HOME% as variable and scaled the same to path variables %ANDROID_HOME%\SDK\TOOLS. This method doesn't work. Experimentally resolved by directly pointing to the Tools and Platform Tools.
推荐答案
您不能添加在iOS平台上的Windows 8(查看链路上可用的命令):
You can't add the iOs platform on Windows 8 (Check the available commands on the link):
你来运行这些命令的能力取决于你的机器是否支持每个SDK,以及是否已经安装每个SDK。
来源:<一href="http://cordova.apache.org/docs/en/3.4.0//guide_cli_index.md.html#The%20Command-Line%20Interface" rel="nofollow">http://cordova.apache.org/docs/en/3.4.0//guide_cli_index.md.html#The%20Command-Line%20Interface
"Your ability to run these commands depends on whether your machine supports each SDK, and whether you have already installed each SDK."
source: http://cordova.apache.org/docs/en/3.4.0//guide_cli_index.md.html#The%20Command-Line%20Interface
Android是陌生的,但..你能否提供更多的细节? (在所有环境变量设置是否正确?你加JAVA_HOME?..)
Android is strange though.. Can you provide any more details? (are all the environment variables set correctly? did you add JAVA_HOME?..)
希望我会更多的是帮助一些更多的信息:)
Hopefully I'll be more of a help with some more info :)
这篇关于同时列出Android的目标时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!