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?
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.