1
votes

In a totally new project, with no code except for the default template, when I import RealmSwift Xcode shows a Swift compiler error like this:

Swift Compiler Error: Command failed due to signal: Segmentation fault: 11

I've followed the Realm installation guide many times over for both CocoaPods and manually installing into a project.

When I don't import RealmSwift, I can build the project.

I'm using Swift version 3.0.2.

1
Can you add a picture of what the debugger looks like?Oren Edrich
@OrenEdrich of course, but i can't compile the project. it is empty. s7.postimg.org/dp9b0roqz/Screen_Shot_2017_03_07_at_19_13_06.pngGreatCornholio
Your screenshots are missing the relevant information. Rather than posting screenshots, can you instead copy the compiler invocation and output from the the build log in Xcode's report navigator? That's the view you're looking at in your most recent screenshot. Click on the "Compile Swift source files" header, then hit Cmd-C to copy the invocation and output, and edit it into your post.bdash

1 Answers

1
votes

I think you're hitting a known issue with the Swift compiler that leads to it crashing when you import a module with the same name as your application target. In this case, you've named your app target "Realm". That's the name of the Objective-C framework that RealmSwift depends on. Importing RealmSwift attempts to import the Realm module, which causes the compiler to get confused because it's not sure if that Realm module is referring to your app or the Realm framework. Renaming your application target so it doesn't share the name with any other modules you depend on should work around this compiler bug.