LoginSignup
1
3

More than 3 years have passed since last update.

Carthageで使うXcode・Swiftのバージョンをコントロールする

Posted at

最近複数の仕事をしていて、Xcodeのバージョンをいくつか使っているんですが
carthageでライブラリーアップデートしてSwiftバージョン違うって言われると辛いですよね
あれめちゃくちゃ長いんですよ
1日溶ける

本題

バージョンが合っていないとこういうエラーが出てきます

<unknown>:0: error: module compiled with Swift 5.2.4 cannot be imported by the Swift 5.1.2 compiler: /Users/XXXXX/ios/yyyyyy/Carthage/Build/iOS/Hoge.framework/Modules/Hoge.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

現在使っているXcodeを確認する

xcode-select --print-path

変更する

sudo xcode-select --switch <path-to-beta-xcode>/Contents/Developer

参考
https://stackoverflow.com/questions/37867753/change-carthage-swift-version

Cocoapodsの場合

環境設定から変更できます

スクリーンショット 2020-07-09 0.32.59.png

これcarthageに反映されないんですね。

1
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3