Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift: XPC connection interrupted and app freezes?

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?

like image 999
blue Avatar asked May 27 '18 23:05

blue


1 Answers

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.

like image 60
ConfusionTowers Avatar answered Nov 16 '22 08:11

ConfusionTowers