所以我已经查看了类似问题的其他答案,每个人似乎都说要解决这个问题,我需要确保android-tools,tools和ant在我的路径中。我已经确定他们在我的道路上,但我仍然遇到这个问题。为了确保我做的一切正确,我已按照此页面的说明进行操作:http://ionicframework.com/docs/guide/installation.html
我使用的是Mac OS X及以下版本,您可以准确地看到错误消息。
BUILD FAILED
/Users/408366/Desktop/adt/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/Users/408366/Desktop/adt/sdk/tools/ant/build.xml:698: null returned: 1
Total time: 1 second
/Users/408366/Google Drive/Web Design/AHS App/Tests/todo/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: ant with args: debug,-f,/Users/408366/Google Drive/Web Design/AHS App/Tests/todo/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/408366/Google Drive/Web Design/AHS App/Tests/todo/platforms/android/cordova/build: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/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)
我使用这些命令将这些东西放在我的路径中:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/408366/Desktop/adt/sdk/tools/:/Users/408366/Desktop/adt/sdk/platform-tools/:/Users/408366/Desktop/ant/bin
launchctl setenv PATH $PATH
谢谢!
答案 0 :(得分:1)
检查文件\ hybrid \ platforms \ android \ cordova \ node_modules \ q \ q.js 在第1718行,有一个'ms'变量。相反,使用像15000这样的整数值。 这些行应如下所示:
var timeoutId = setTimeout(function () {
deferred.reject(new Error(message || "Timed out after " + ms + " ms"));
}, 15000);
享受!