1

I'm getting a bizarre crash after upgrading to Swift 4.1

Every time a user logs in to my app with the Facebook app using the NATIVE option (this opens your facebook app itself if its installed on the device). I am getting the following exception

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

The screen looks like this FYI:

My app isn't blubshare, I pulled this off the internet

All Crashlytics gives me is the following

AppDelegate.swift line 0 @objc AppDelegate.application(UIApplication, open : URL, sourceApplication : String?, annotation : Any) -> Bool 2 UIKit
__58-[UIApplication _applicationOpenURLAction:payload:origin:]_block_invoke + 880

I've been able to repro on my device, and the local crash logs are equally not helpful. The crash hits on the first line of my AppDelegate file, and there is nothing to backtrace through in intelligible code.

This apparently is the offending line.

class AppDelegate: UIResponder, UIApplicationDelegate {

I've tried enabling Zombie objects since EXC_BAD_ACCESS usually means something got deallocated, to gather some data with no luck.

Whats strange is if I do the following:

let login:FBSDKLoginManager = FBSDKLoginManager()
    login.loginBehavior = .web

No crash happens. This makes me believe that when the .native option (the default if you have facebook installed) is used, the app switching is causing the crash somehow.

Using .web is a temporary work around, but I'd really like a root cause to why this would cause a crash. The FBSDKLoginKit is on version 4.32.0 for me.

Any ideas or help are appreciated.

Unome
  • 6,750
  • 7
  • 45
  • 87
  • Enable Exception Breakpoints on Xcode and try reproducing the crash. This time it should stop at a more helpful part of the code. Also Post the crash stack trace. I'd also share the code you use for FB login. Maybe you are not holding a strong reference to FB object and it's deallocated when app goes into background to do the SSO – Lefteris Apr 20 '18 at 05:26
  • The solution for this similar question fixed it for me https://stackoverflow.com/questions/49823007/fbsdkloginkit-is-crashing-for-unknown-reason-on-ios11-3-version – jamone May 01 '18 at 20:43

0 Answers0