読者です 読者をやめる 読者になる 読者になる

What we talk about when we talk about Technology

技術について語ります。

ReSwiftに挫折する日曜日。

iOS

エンジニアをやっていると「今日はダメだ。。」という日が(しょっちゅう)ある。

今日は気になっていたReSwiftを調べてみた。

github.com

きっかけは以下のブログ。

in.fablic.co.jp

他にも、

qiita.com

や、

qiita.com

を見て、Reduxへの興味が積もっていた。

ということで、ドキュメントをつらつらと読み、
サンプルを書いてみようということで、carthage update

** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistorySliderView.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryCollectionViewCell.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryView.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(5 failures)
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
A shell task (/usr/bin/xcrun xcodebuild -project /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder.xcodeproj -scheme ReSwiftRecorder -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistorySliderView.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryCollectionViewCell.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryView.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(5 failures)

むむむ。。。

ReSwift-Recorderが、依存しているReSwiftモジュールをうまく参照できてない模様。

carthageのバージョンが最新じゃなかったので、
アップデートしてみようと思ったのだけども、
どうやらhomebrewではなくパッケージインストールしていたらしい。

というわけで、homebrewでインストール、それまでのcarthageをrmしてcarthage update

dyld: Library not loaded: @rpath/libswiftAppKit.dylib
  Referenced from: /usr/local/bin/carthage
  Reason: Incompatible library version: carthage requires version 1.0.0 or later, but libswiftAppKit.dylib provides version 0.0.0
zsh: trace trap  carthage version

おお。。。

github.com

これっぽいんだけども、/Library/Frameworksがない。。。

仕方なく、再びパッケージでインストールしてcarthage update

** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistorySliderView.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryCollectionViewCell.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryView.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(5 failures)
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
/Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift:10:8: error: no such module 'ReSwift'
A shell task (/usr/bin/xcrun xcodebuild -project /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder.xcodeproj -scheme ReSwiftRecorder -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/RecordingStore.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistorySliderView.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryCollectionViewCell.swift
    CompileSwift normal arm64 /Users/kentakudo/Desktop/CounterExample/Carthage/Checkouts/ReSwift-Recorder/ReSwiftRecorder/UI/StateHistoryView.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(5 failures)

再び。orz。

今日はここで心折れました。。

おとなしくcocoapods使えばいいんかな。。