何が起きたか
CocoaPodsのバージョンを1.0.1にしてプロジェクトをビルドしたら、Realm/RLMArray.h file not foundになった。
Error on line 21 of Realm.h Realm/RLMArray.h file not found and Could not build Objective-C module 'Realm'
環境
- OS X El Capitan 10.11.6
- Xcode 7.3.1
- CocoaPods 1.0.1
- Realm 1.0.1
- RealmSwift 1.0.1
解決方法
1. コマンドラインからCocoaPodsのcacheをクリアする。
$ pod cache clean Realm
$ pod cache clean RealmSwift
2. XcodeでClean Build Folder...を実行する。
3. コマンドラインからpod installする。
$ pod install
Analyzing dependencies
Downloading dependencies
Installing BEMCheckBox (1.2.1)
Installing FlatUIKit (1.6.2)
Installing Nimble (3.0.0)
Installing Quick (0.9.1)
Installing Realm (1.0.1)
Installing RealmSwift (1.0.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete!
4. XcodeでBuildする。Build Succeededしました。
なぜ起きたか
不明。
CocoaPodのバージョンに起因しているのではと当たりをつけているが、詳細までは突っ込んでいない。