realm-swift: Realm/RLMArray.h file not found and Could not build Objective-C module 'Realm'

Goals

Install Realm using Cocoapods 1.0

Expected Results

I expect it to install and work as per the instructions on https://realm.io/docs/swift/latest/

Actual Results

Error on line 21 of Realm.h Realm/RLMArray.h file not found and Could not build Objective-C module 'Realm'

Steps to Reproduce

Add RealmSwift to podfile and run pod install

Version of Realm and Tooling

Realm version: 0.102.0

Xcode version: 7.3.1

iOS/OSX version: 8.0

Cocoapods version: 1.0

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 29 (5 by maintainers)

Most upvoted comments

So, I am a little ashamed that I didn’t try this earlier, but it appears that if I run Clean Build Folder... (Hold down option while clicking Product in the Xcode menu shows the Clean Build Folder... option) it fixes the issue for me.

Some additional info:

I have been using Realm with Cocoapods 0.39 for a couple months with no problem. With the release of Cocoapods 1.0 I am now seeing this error.

I have tried:

pod cache clean Realm
pod cache clean RealmSwift
pod deintegrate || rm -rf Pods
pod install

I have removed RealmSwift from my cocoapod, run pod install added RealmSwift back into the podfile and run pod install again. Nothing seems to make any kind of difference for me. I still get the Realm/RLMArray.h file not found message.

I have verfied that that file does exist and is included in the Headers group in the project. Not sure what the problem is.

Let me know if there is any additional information that I can get you that would be helpful.

Only clean build folder is not working for me. I have to clear CocoaPods cache first, then Clean Build Folder... and do the pod install.

Looks like there may have been some changes in the last few CocoaPods 1.0 RC’s that actually broke Realm support in some cases, I’m hunting down exactly what those are for now, or if I’m doing something wrong, because I think I was able to reproduce this. I’ll keep you posted.