Swift: XPC connection interrupted and app freezes?
Asked Answered
G

2

7

Ok, have no idea what is going on here but from what I understand from other questions (XPC connection interrupted in Xcode 7 for iOS 9) , XPC connection interrupted means theres a storyboard problem. Per a similar answer I opened the storyboard as source code and looked for repeated

<keycommand>

tags, but there aren't any. I had to copy and paste a storyboard from another project since something changed, and I believe this caused it. What are my options here? What could be causing this freeze since there aren't any weird tags that I can see?

Genous answered 27/5, 2018 at 23:48 Comment(3)
XPC communications and storyboards are completely unrelated. Could you share the "other questions" that might make you think this is a storyboard problem? XPC is an interprocess messaging service and the typical reason a connection gets interrupted is because the process at the other end of the XPC connection crashed.Outcrop
Try clean the project and build folder and run it againHyunhz
@JamesBucanek They were referring to this question: #32684657Wadding
A
6

Same problem, getting the XPC error when tapping in a (SwiftUI) Text Field. Different solution:

Simulator > Device > Erase All Content and Settings

As described here,

The problem came from the keyboard that wasn't showing up. And I am not really sure why, I probably pressed a command that disables it.

To get it to work I have restarted the simulator. In the simulator menu, Hardware > Erase All Content And Settings

Now when I tap in a UITextField, the keyboard shows up and I don't get the "XPC connection interrupted" error anymore. Everything works fine.

This error was incredibly frustrating because there is no crash report, just a one-line "XPC connection interrupted" and the app freezes. And, to complicate things, it's apparently possible to get this error from some wildly differing causes -- various discussions have cases of VPN's, Bluetooth, and threading generating this. And of course -- Murphy's law -- I started getting the error after having implemented something utterly unrelated, but which has me troubleshooting threading & Core Data issues, all to no avail.

Hopefully this can help somebody else with the quick fix.

Abbieabbot answered 30/6, 2020 at 20:59 Comment(0)
O
0

The problem for me was that there are two storyboards, the main storyboard and the launchScreen storyboard. If you go to the top left of Xcode and click on the Xcode file, it will bring you to a screen about the file. You then scroll to deployment info and switch the main interface to whichever storyboard you use. I think that since you copied and pasted the code is not linked up to the storyboard.

Orthoclase answered 16/7, 2018 at 15:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.