Eric Duffett Eric Duffett - 3 months ago 119
Swift Question

Upgraded Firebase - Now Getting Swift Compile Error

I upgraded Firebase yesterday and now am having a very unusual problem. When I run the simulator, I get a swift compile error "Segmentation fault: 11" The are hundreds of lines of code describing the error, but they are absolutely no help. From the error, the only thing I see that might be giving clues is at the bottom. It says:

1. While loading members for 'ProfileTableViewController' at <invalid loc>
2. While deserializing decl #101 (PATTERN_BINDING_DECL)
3. While deserializing decl #2 (VAR_DECL)

Oddly, the errors I just typed above are not consistent. The view controller mentioned rotates between the three view controllers where I am using Firebase.

To try to solve the problem, I commented out all of the code in the ProfileTableViewController class, but I still got an error referencing that view controller. The only code running in the view controller was:

import UIKit
import Firebase
import FirebaseDatabase

(I'm also using FirebaseAuth in other view controllers).

What does work to fix the problem is to hit "clean", restart xcode, clean again on launch and then run the program. Everything will work fine unless I make any changes to the code in the program. Even if all I do is add a comment, the error will reappear.

I don't want to have to close xcode and restart every time I write a couple lines of code, and I am worried that I will run into problems when uploading to the app store.

I am using XCode 7.3.1 and my deployment target is 9.3

Any insight you can give is greatly appreciated! Thank you!


I was able to figure it out! My Cocoa Pods were not up to date. As soon as I went back and installed the latest Cocoa Pods in the terminal, then updated the podfile for this app, this error disappeared.


Open terminal

  sudo gem install cocoapods

(Cocoapods update) In terminal navigate to app folder, then:

  open -a xcode podfile

If needed, make changes in podfile. I didn't need to make any changes. Save and exit.

In terminal

  pod update

Open the .xcworkspace file and ta da!