在phonegap docs(http://cordova.apache.org/docs/en/3.5.0//guide_cli_index.md.html)的帮助下,我成功安装了node.js,git client和cordova 3.5.0。 而且我也能够安装windows8和wp8。 但是在安装android时,我收到以下错误:
C:\Users\rajkiranb\hello>cordova platform add android
Creating android project...
C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:12
6
throw e;
^
Error: An error occurred while listing Android targets
at C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.
js:87:29
at _rejected (C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\node
_modules\q\q.js:808:24)
at C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\
q.js:834:30
at Promise.when (C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\n
ode_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\rajkiranb\.cordova\lib\android\
cordova\3.5.0\bin\node_modules\q\q.js:752:41)
at C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\
q.js:574:44
at flush (C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\node_mod
ules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: C:\Users\rajkiranb\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Com
mand failed with exit code 8
at ChildProcess.whenDone (C:\Users\rajkiranb\AppData\Roaming\npm\node_module
s\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
在计算机中 - > C - >环境变量.. 在用户变量和系统变量中,我添加了ANT。
ANT_HOME = C:\ Program Files(x86)\ WinAnt
但没有运气。
请帮帮我。
答案 0 :(得分:1)
将此直接添加到路径变量
C:\用户\ rajkiranb \机器人\ ADT-束 - 窗口x86_64-20140321 \ SDK \平台的工具; C:\用户\ rajkiranb \机器人\ ADT-束 - 窗口x86_64-20140321 \ SDK \工具
请参阅第二个tools
而非build-tools
答案 1 :(得分:0)
检查您是否将ANDROID_HOME
系统变量设置为android sdk location