Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgraded Firebase - Now Getting Swift Compile Error

Tags:

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!

like image 718
Eric Duffett Avatar asked May 20 '16 12:05

Eric Duffett


2 Answers

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.

Process:

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!

like image 155
Eric Duffett Avatar answered Sep 23 '22 15:09

Eric Duffett


I was also pulling my hair out with this issue for some time. I tried Eric Duffett's answer but without luck.

I figured out it was an issue with the FirebaseAuth. What I did was this:

  1. Remove FirebaseAuth from Podfile
  2. Update pods with pod update
  3. Download Firebase frameworks from their site (at the bottom)
  4. Follow README file to import FirebaseAuth manually in the project (need to import FirebaseAuth.framework and GoogleNetworkingUtilities.framework)
  5. Clean - Build and no more segmentation fault 11 error

Hope this will help someone.

like image 37
JPetric Avatar answered Sep 24 '22 15:09

JPetric