Error adding Realm to a Swift project - "Umbrella header 'Realm.h' not found"

1,652 views
Skip to first unread message

Frank Radocaj

unread,
Jun 4, 2015, 10:31:06 PM6/4/15
to realm...@googlegroups.com
Hi,

I'm trying to use the Realm ObjC version in my Swift iOS project (because i'm targeting iOS7+). I've downloaded the latest Realm (v 0.93.1) through CocoaPods, but I get the following error when I try to Import Realm into my model class.

framework module Realm {

    umbrella header "Realm.h" // Error is here: "Umbrella header 'Realm.h' not found"


    export *

    module * { export * }


    explicit module Private {

        header "RLMArray_Private.h"

        header "RLMListBase.h"

        header "RLMMigration_Private.h"

        header "RLMObjectSchema_Private.h"

        header "RLMObjectStore.h"

        header "RLMObject_Private.h"

        header "RLMProperty_Private.h"

        header "RLMRealmUtil.h"

        header "RLMRealm_Dynamic.h"

        header "RLMRealm_Private.h"

        header "RLMResults_Private.h"

        header "RLMSchema_Private.h"

    }

}


I have a Bridging header file which seems to be OK (no compiler errors):



#ifndef Rehab_Bridging_Header_h

#define Rehab_Bridging_Header_h


#import "Realm.h"


#endif


Am I trying to do something impossible or just some newbie mistake?



Samuel Giddins

unread,
Jun 5, 2015, 2:13:50 PM6/5/15
to Frank Radocaj, realm...@googlegroups.com
Hi Frank,
Could you please share your Podfile?

--
Samuel Giddins



--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/43dc7348-4bcc-4956-910f-7d754c730d5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



{#HS:95780605-1262#}

Frank Radocaj

unread,
Jun 5, 2015, 10:05:41 PM6/5/15
to realm...@googlegroups.com, he...@realm.io
Hi Samuel, this is the podfile:


source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '7.0'


pod 'Realm', '0.93.1'

Samuel Giddins

unread,
Jun 7, 2015, 8:26:29 PM6/7/15
to Frank Radocaj, realm...@googlegroups.com
Hi Frank,
Given that you haven't specified the `use_frameworks` flag, I find it odd that CocoaPods is setting up a module map at all. Keep in mind, since you're not using a framework, you can do `import Realm` in your Swift files, and must instead only use the bridging header. I hope that helps!

--
Samuel Giddins
{#HS:95780605-1262#}

Frank Radocaj

unread,
Jun 7, 2015, 8:49:57 PM6/7/15
to realm...@googlegroups.com
In trying to get it working, I did add the use frameworks flag at one stage, so I suspect my cocoapods project was a bit messed up. Anyway, I ended up just adding Realm directly to my project which worked.

Thanks for your help.

Ivan Schuetz

unread,
Jul 13, 2015, 4:11:21 PM7/13/15
to realm...@googlegroups.com

Hi,

I algo got this error, installed realm the first time, v.0.93.2, XCode 6.3.2

I have a multitarget project (OSX/iOS) and I'm using a bridging header for both.

User Header Search Paths is set to Pods/**, I need this to get my pods working.

This is my podfile:

def shared
    use_frameworks!
    pod 'Alamofire', '~> 1.2'
    pod 'Valet', '~> 1.3'
    pod 'RealmSwift'
end

target ‘myproj_osx' do
    platform :osx, '10.10'
    shared
end

target 'myproj_ios’ do
    platform :ios, '8.0'
    pod 'WYPopoverController', '~> 0.2.2'
    shared
end

target 'myproj_tests' do
    platform :osx, '10.10'
    shared
    pod 'Quick', '~> 0.3.0'
    pod 'Nimble', '~> 0.4.0'

end

Before adding realm everything was working...

Besides of that it's maybe worth adding here that the manual installation dragging into embedded frameworks also doesn't seem to work for multitarget. Dragging to the iOS target works, but when I drag the OSX framework to the OSX target XCode shows unknown error.

Samuel Giddins

unread,
Jul 13, 2015, 4:37:11 PM7/13/15
to Ivan Schuetz, realm...@googlegroups.com
Hi Ivan,
Since you've specified `use_frameworks!` in your Podfile, I'd recommend against using a bridging header to import your Pods, and instead would use `@import PodName;` in Obj-C, or `import PodName` in swift.

--
Samuel Giddins



On Mon, Jul 13, 2015 at 8:11 PM UTC, Ivan Schuetz <ivans...@gmail.com> wrote:
Hi,

I algo got this error, installed realm the first time, v.0.93.2, XCode 6.3.2

I have a multitarget project (OSX/iOS) and I'm using a bridging header for
both.

User Header Search Paths is set to Pods/**, I need this to get my pods
working.

This is my podfile:

def shared
use_frameworks!
pod 'Alamofire', '~> 1.2'
pod 'Valet', '~> 1.3'
pod 'RealmSwift'end

target ‘myproj_osx' do platform :osx, '10.10' sharedendtarget 'myproj_ios’ do

platform :ios, '8.0'
pod 'WYPopoverController', '~> 0.2.2'
sharedend

target 'myproj_tests' do
platform :osx, '10.10'
shared
pod 'Quick', '~> 0.3.0'
pod 'Nimble', '~> 0.4.0'
end

Before adding realm everything was working...

Besides of that it's maybe worth adding here that the manual installation
dragging into embedded frameworks also doesn't seem to work for
multitarget. Dragging to the iOS target works, but when I drag the OSX
framework to the OSX target XCode shows unknown error.



Am Montag, 8. Juni 2015 02:49:57 UTC+2 schrieb Frank Radocaj:



{#HS:104353846-1480#}

Ivan Schuetz

unread,
Jul 13, 2015, 4:50:14 PM7/13/15
to Samuel Giddins, realm...@googlegroups.com
I'm not using the bridging header to import Realm. I just wrote that I'm using a bridging header (need it for other pods), because I found an issue in Github where this was mentioned and thought it might be related.

I'm importing with

`import RealmSwift`




Samuel Giddins

unread,
Jul 13, 2015, 4:55:29 PM7/13/15
to Ivan Schuetz, realm...@googlegroups.com
In that case, I'm guessing that manually changing the user header search paths is interfering with the xcconfig that CocoaPods creates? I'd be happy to take a look if you can share a project that exhibits this issue, though!

--
Samuel Giddins
{#HS:104353846-1480#}

Ivan Schuetz

unread,
Jul 13, 2015, 5:03:39 PM7/13/15
to Samuel Giddins, realm...@googlegroups.com
I'm a bit short of time to prepare an example project but I'll try. Thanks to your comment I just noticed that I can get rid of the bridging headers completely because all the libraries can be imported as framework. This didn't help with Realm though.

Samuel Giddins

unread,
Jul 13, 2015, 5:08:59 PM7/13/15
to Ivan Schuetz, realm...@googlegroups.com
That's strange. Are you using CocoaPods 0.37.2? Can you try running the following commands:

rm -rf Pods
rm -rf ~/Library/Caches/CocoaPods
pod install

and building again? Thanks!

--
Samuel Giddins



On Mon, Jul 13, 2015 at 9:04 PM UTC, Ivan Schuetz <ivans...@gmail.com> wrote:
I'm a bit short of time to prepare an example project but I'll try. Thanks
to your comment I just noticed that I can get rid of the bridging headers
completely because all the libraries can be imported as framework. This
didn't help with Realm though.



On Mon, Jul 13, 2015 at 8:55 PM UTC, Help <he...@realm.io> wrote:
In that case, I'm guessing that manually changing the user header search paths is interfering with the xcconfig that CocoaPods creates? I'd be happy to take a look if you can share a project that exhibits this issue, though!

--
Samuel Giddins



On Mon, Jul 13, 2015 at 8:50 PM UTC, Ivan Schuetz <ivans...@gmail.com> wrote:
I'm not using the bridging header to import Realm. I just wrote that I'm using a bridging header (need it for other pods), because I found an issue in Github where this was mentioned and thought it might be related.

I'm importing with


`import RealmSwift`



On Mon, Jul 13, 2015 at 8:36 PM UTC, Help <he...@realm.io> wrote:
{#HS:104353846-1480#}

Ivan Schuetz

unread,
Jul 13, 2015, 5:16:59 PM7/13/15
to Samuel Giddins, realm...@googlegroups.com
That didn't help. Thanks for the quick answer btw.

Samuel Giddins

unread,
Jul 13, 2015, 5:29:26 PM7/13/15
to Ivan Schuetz, realm...@googlegroups.com
In that case, I'd probably need a project to be able to debug what's happening, sorry.

--
Samuel Giddins




On Mon, Jul 13, 2015 at 9:17 PM UTC, Ivan Schuetz <ivans...@gmail.com> wrote:
That didn't help. Thanks for the quick answer btw.



On Mon, Jul 13, 2015 at 9:08 PM UTC, Help <he...@realm.io> wrote:
That's strange. Are you using CocoaPods 0.37.2? Can you try running the following commands:

rm -rf Pods
rm -rf ~/Library/Caches/CocoaPods
pod install

and building again? Thanks!

--
Samuel Giddins



On Mon, Jul 13, 2015 at 9:04 PM UTC, Ivan Schuetz <ivans...@gmail.com> wrote:
I'm a bit short of time to prepare an example project but I'll try. Thanks
to your comment I just noticed that I can get rid of the bridging headers
completely because all the libraries can be imported as framework. This
didn't help with Realm though.



On Mon, Jul 13, 2015 at 8:55 PM UTC, Help <he...@realm.io> wrote:
In that case, I'm guessing that manually changing the user header search paths is interfering with the xcconfig that CocoaPods creates? I'd be happy to take a look if you can share a project that exhibits this issue, though!

--
Samuel Giddins



On Mon, Jul 13, 2015 at 8:50 PM UTC, Ivan Schuetz <ivans...@gmail.com> wrote:
I'm not using the bridging header to import Realm. I just wrote that I'm using a bridging header (need it for other pods), because I found an issue in Github where this was mentioned and thought it might be related.

I'm importing with


`import RealmSwift`



{#HS:104353846-1480#}

Ivan Schuetz

unread,
Jul 13, 2015, 6:11:48 PM7/13/15
to Samuel Giddins, realm...@googlegroups.com
It seems I found the issue. It's the Pods/** in the User Header Search Paths. I added this because of some problems I had in the past with the multitarget setup. I just removed it and everything is working fine. Probably the cleanup fixed the setup...

Thanks!

Samuel Giddins

unread,
Jul 13, 2015, 6:22:39 PM7/13/15
to Ivan Schuetz, realm...@googlegroups.com
Glad to hear you got everything working, Ivan!

--
Samuel Giddins
{#HS:104353846-1480#}
Reply all
Reply to author
Forward
0 new messages