10
votes

My app crashes on some iPhone 5S device (only some) with the error:

Fatal Exception: NSInternalInconsistencyException Unexpected error: Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)" (connection to service named com.apple.CoreAuthentication.daemon) UserInfo=0x174461dc0 {NSDebugDescription=connection to service named com.apple.CoreAuthentication.daemon}

The line which breaks the app is the following:

LAContext().canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: nil)

Is this an Apple bug? What am I doing wrong here?

1
Did you try restarting iPhone? Are you sure you have iPhone 5S? - Ben Affleck
The app is not crashing for me - just for some of my users - YogevSitton
this is really weird! - Ben Affleck
I agree - that's why I posted it here - YogevSitton
I'm having this crash only on iPhone 6. That too using for long time. Its working fine with iPhone5s. Really weird. - arunit21

1 Answers

2
votes

It's an iOS bug. When an API returns a 4097 error, it usually means that the system daemon that was responsible for handling your request crashed. You can look for crash logs from the device and file a bug with Apple.