LoginSignup
19
12

More than 5 years have passed since last update.

carthageのバージョンを今すぐ上げよう

Last updated at Posted at 2017-04-11

https://github.com/Carthage/Carthage
carthageはbinaryが用意されてる時はそれを落としてきてくれるのでビルド時間短縮になりますが、importしたbinaryが現在のswift versionと異なる環境で作られていた場合、下記のようなエラーが出ると思います。

Module compiled with Swift 3.0.2 cannot be imported in Swift 3.1

carthageのversion0.20以降ではbinaryをチェックして、そのbinaryが作られた環境とlocal環境のswift versionが異なっていた場合には、よしなにビルドしてくれるようになったようです。
https://github.com/Carthage/Carthage/releases
素晴らしすぎる。

実際の例) 
binaryが作られたswift version 3.0.2
localのswift version 3.1

$ carthage update --platform ios
*** Fetching SwiftyJSON
*** Downloading SwiftyJSON.framework binary at "3.1.4"
*** Skipped installing SwiftyJSON.framework binary due to the error:
    "Incompatible Swift version - framework was built with 3.0.2 and the local version is 3.1."
*** Checking out SwiftyJSON at "3.1.4"

もしまだ古いversionのcarthageを使っている場合はupgradeしておいて損はないと思います。

例)
$ brew upgrade carthage
19
12
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
19
12