ionic build ios命令不起作用

时间:2016-08-21 18:20:35

标签: ionic-framework

我已经完成了教程说明,设置了cordova和离子。我可以在开发中成功运行应用程序,但在构建ios时会出现此错误。有任何想法吗?尝试更新节点和cordova。

sudo ionic build ios                

Running 'build:before' gulp task before build
[11:16:00] Starting 'clean'...
[11:16:00] Finished 'clean' after 47 ms
[11:16:00] Starting 'build'...
[11:16:00] Starting 'sass'...
[11:16:00] Starting 'html'...
[11:16:00] Starting 'fonts'...
[11:16:00] Starting 'scripts'...
[11:16:00] Finished 'scripts' after 45 ms
[11:16:00] Finished 'html' after 51 ms
[11:16:00] Finished 'fonts' after 54 ms
[11:16:00] Finished 'sass' after 770 ms
[11:16:07] Finished 'build' after 7.18 s
[11:16:07] Starting 'build:before'...
[11:16:07] Finished 'build:before' after 11 μs

• You're trying to build for ios but don't have the platform     installed yet.
∆ Installing ios for you.
Installing cordova-plugin-device
Installing cordova-plugin-console
Installing cordova-plugin-whitelist
Installing cordova-plugin-splashscreen
Installing cordova-plugin-statusbar
Installing ionic-plugin-keyboard
Error: Command failed: /bin/sh -c cordova platform add ios
Error: Platform ios already added.

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:821:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:4

69:12)

1 个答案:

答案 0 :(得分:0)

首先,您似乎在ios平台安装上遇到了一些问题,请尝试删除它并将其添加回您的开发空间。

在尝试为ios构建之前运行命令ionic platform remove ios && ionic platform add ios

其次,您需要使用Mac操作系统来构建ios应用程序,因为它依赖于要构建的XCode(本机软件)。

第三,如果你仍然有相同的iussue,那么可能是由于这里描述的错误。 this RData dataset

尝试sudo npm install -g cordova并重新运行构建。

祝你好运。