下記の記事を参考にVaporでサーバーサイドSwiftの環境構築を行った時に、以下のエラーが出てハマった話。
VaporでサーバーサイドSwiftを試してみた
結果から書くと、プロジェクト内のcloud.ymlで定義していたswift_versionとインストールされているswiftのバージョンの不一致が原因だった。
cloud.yml
swift_version: "4.1.0"
以下のコマンドでインストールされているswiftのバージョン確認
terminal
$ swift -version
※自分の場合swift_version: "5.0.1"に修正して、再度vapor xcodeを実行したら成功した。
cloud.yml
# swift_version: "4.1.0"
swift_version: "5.0.1"
terminal
$ vapor xcode
これで通った!
以下、出力されたエラー↓
terminal
$ vapor xcode
Generating Xcode Project [Failed]
/Users/~/Hello: error: manifest parse error(s):
<module-includes>:5:9: note: in file included from <module-includes>:5:
¥#import "copyfile.h"
^
~省略~
<unknown>:0: error: could not build Objective-C module 'Darwin'