2016-08-21 56 views
0

我已經通過教程說明來設置科爾多瓦和離子。我可以在開發中成功運行該應用程序,但在構建ios時會出現此錯誤。有任何想法嗎?嘗試更新節點和科爾多瓦。離子建立ios命令不起作用

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)

回答

0

首先,看來你對iOS平臺上安裝的一些問題,嘗試刪除它,並把它加回到你的發展空間。

運行命令ionic platform remove ios && ionic platform add ios在嘗試爲ios構建之前。其次,您需要Mac操作系統來構建ios應用程序,因爲它依賴於XCode(本機軟件)來構建。

第三,如果你仍然有相同的iussue,那麼這可能是由於這裏描述的一個bug。 https://github.com/driftyco/ionic-cli/issues/772

嘗試sudo npm install -g cordova並重新運行構建。

祝你好運。

+0

我在安裝了xcode的mac上運行。我運行這些命令,仍然收到相同的錯誤..任何其他想法? –

+0

我發現您的cordova安裝中可能存在一個錯誤。嘗試重新安裝它。在這裏查看更多https://github.com/driftyco/ionic-cli/issues/772 –