RxSwiftのPlaygroundが error: Couldn't lookup symbols が出て動かないとき


問題

RxSwiftの勉強をするためにPlaygroundで遊ぼうと思ったら error: Couldn't lookup symbols: というエラーが発生し動作しない。

以下のようにPlayground環境を作った。

  1. プロジェクト作成
  2. pod init 実行
  3. Podfile に pod RxSwiftpod RxCocoa を追加
  4. pod install 実行
  5. Xcodeの「File」-> 「New」 -> 「Playground」でPlaygroundを追加
  6. import RxSwift を記述しRxSwiftのなにかを書く

環境

  • Xcode -> Version 10.0 beta 5 (10L221o)
  • CocoaPods -> 1.5.3
  • RxSwift -> 4.2.0

解決策

以下を参考に次のように試した。
https://github.com/ReactiveX/RxSwift/issues/1660#issuecomment-404779160

  1. Playground上に書いた import RxSwift を削除
  2. クリーン (CMD + Shift + K)
  3. ビルド (CMD + B) (RxSwiftをimportしていないのでもちろんエラーで終わる)
  4. import RxSwift を再び復活させる
  5. 無事に動く!!