Flutter app crashing on iOS 16 when restarted because of flutter_facebook_auth pack

1.1k Views Asked by At

I am facing an issue with my Flutter application when running it on a device with iOS 16.

The application works fine when I initially launch it from Xcode, and it also works correctly when I hot reload it.

However, if I close the application on the device and try to reopen it, it crashes.

I am currently using flutter_facebook_auth: ^6.0.1. The issue doesn't occur on other devices, emulators, or on Android - it is specific to iOS 16.

In an attempt to diagnose the issue, I followed all the setup steps correctly according to the documentation, including the correct setup of Info.plist with the appropriate Facebook configurations.

I am suspecting that the issue is occurring during the registration of the Facebook Auth plugin, as indicated by the crash logs pointing to SwiftFlutterFacebookAuthPlugin.register(with:).

Has anyone experienced a similar issue or has any insights on how to fix this? Any help would be greatly appreciated.

Here are the device output logs from the moment it crashes:

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000 VM Region Info: 0 is not in any region. Bytes before following region: 4310401024 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START

__TEXT 100eb8000-1011d4000 [ 3184K] r-x/r-x SM=COW ...er.app/Runner Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [3399]

Triggered by Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libswiftCore.dylib 0x1b2527a6c swift_getObjectType + 36 1 flutter_facebook_auth 0x101a663a0 static SwiftFlutterFacebookAuthPlugin.register(with:) + 132 2 flutter_facebook_auth 0x101a665bc @objc static SwiftFlutterFacebookAuthPlugin.register(with:) + 56 3 flutter_facebook_auth 0x101a602d8 +[FlutterFacebookAuthPlugin registerWithRegistrar:] + 72

I tried flutter clean , pod update , restarting the device . Launching app without a crash is expected.

1

There are 1 best solutions below

0
Berk Inan On

After researching, I stumbled upon a note mentioning that starting from iOS 14, launching an app in debug mode from the home screen can lead to a crash.

Based on this, I tried deploying my app in release mode on an iOS 16 device and, fortunately, the error didn't occur in release mode.

To anyone facing a similar issue, a potential solution is to test and deploy your app in release mode to avoid this crash.

I hope this helps others facing the same problem.