realm-swift: Realm.h not found via cocoapods

Goals

I’ve formatted my macbook and then I’ve made a fresh install of my development environment (latest XCode version, cocoapods 1.0.0). I’ve cloned an old Objective C project and downloaded all its dependencies using cocoapods. When i try to build it, it fails because of a missing Realm header. It’s imported in my project as

#import "Realm.h"

Expected Results

The project builds as usual

Actual Results

Build failing: Realm.h not found

Steps to Reproduce

  1. Include Realm 0.98.1
  2. Import as #import "Realm.h"
  3. Build the project

Realm version: 0.98.1

Xcode version: 7.3

iOS/OSX version: 8.4

Dependency manager + version: cocoapods 1.0.0,

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@thegreatmichael faced with this issue by myself today 😃 My solution was to remove all Xcode’s Derived Data (or alt+shift+cmd+K in project). Glad to hear that you also resolved this issue 😃

I also have the same issue, umbrella header not found. It seems like a bug of Cocoapods, public headers treat as private headers.

Update Build success after setting User Header Search Paths to empty instead of ${PODS_ROOT}

thanks for checking in @stel, i am on 1.0.1 /-: My User Header Search Paths is $(PODS_ROOT) recursive and $(PODS_ROOT)/ionicons recursive.

update: so, i just started at the top of this thread again, I (have my project working fine on another machine, and so I) checked out my project again, did as in https://github.com/realm/realm-cocoa/issues/3735#issuecomment-226522681 and made sure my User Header Search Paths is empty, and doggonit, it works!!

Hi! I have tried the first solution and the error persists: I’ll list what I’ve done to make sure that I haven’t missed anything:

First attempt

  1. Download a clean version of the project
  2. Go to the project’s root
  3. Execute the following commands
pod cache clean Realm
pod cache clean RealmSwift #Actually I dont need this since I'm using objective C, but I've added it just in case
pod install
pod deintegrate || rm -rf Pods
pod install --verbose

Result: I’m getting Realm.h not found

I’ll try the second approach asap.