如何在Windows中为cordova添加android和iphone应用程序。
当我通过此命令添加时:cordova platform add android
我收到以下错误
Creating android project...
C: \Users\dheeraj\.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\dheeraj\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js: 87: 29
at _rejected(C: \Users\dheeraj\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 808: 24)
at C: \Users\dheeraj\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 834: 30
at Promise.when(C: \Users\dheeraj\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 1079: 31)
at Promise.promise.promiseDispatch(C: \Users\dheeraj\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 752: 41)
at C: \Users\dheeraj\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 574: 44
at flush(C: \Users\dheeraj\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js: 108: 17)
at process._tickCallback(node.js: 415: 13)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone(C: \Users\dheeraj\AppData\Roaming\npm\node_modules\cordova\src\superspawn.js: 112: 23)
at ChildProcess.EventEmitter.emit(events.js: 98: 17)
at maybeClose(child_process.js: 735: 16)
at Process.ChildProcess._handle.onexit(child_process.js: 802: 5)
请帮助解决此问题。 提前谢谢
答案 0 :(得分:0)
试试这个
使用brew安装ant。
通过在终端中执行以下命令来下载并安装Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
执行
,通过Homebrew安装Apache Antbrew install ant
再次运行PhoneGap构建,它应该成功编译并安装您的Android应用程序。