Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XPC connection interrupted in Xcode 7 for iOS 9

I recently updated to Xcode 7 and upgraded my iPhone to iOS 9. I have developed and released an iOS app that had worked perfectly fine on the latest version of iOS 8 and Xcode 6.

Upon trying to go through the process of updated the app for iOS 9 support, I am getting the most ridiculously strange error that has left me baffled.

I have done all the syntax corrections automatically through Xcode, and now my app builds properly. It even runs fine at first.

I have a button that segues to a view controller with a WebView. This view controller loads a link that will display either an image, website, or video from youtube. The content is loaded perfectly fine as always. However, the program will crash and reboot the simulator (and my iPhone) and send me to the lock screen when I click the Back button (I am on a navigation stack).

In Xcode, I get the following messages:

XPC Connection Interrupted. Terminating since there is no system app.

I have Flurry analytics integrated in my app by the way, not sure if thats an issue.

How can I fix this issue? My searches for XPC connections do not seem to return problems similar to mine. I do not even have a clue what an XPC connection is, so why is this in my app anyway?

EDIT: I have found a workaround for the issue. I cannot really say it is a fix.

The crashing was occurring during the use of the method self.navigationController?.popViewControllerAnimated, when set to true. I happened to set this to false, and the crashing stops (now the transition looks awful).

I do not know why this works, and just adds to my confusion.

like image 455
iOShepherd Avatar asked Sep 20 '15 20:09

iOShepherd


4 Answers

The problem lied in the storyboard for me as well. I created a new project and laid out the views and everything seemed to be working fine. I found these couple lines in the storyboard source (right click on storyboard and select view as -> source code) which weren't common between the working version and the broken version:

<keyCommands>
    <keyCommand/>
</keyCommands>

I have no idea what those lines are supposed to do, or how they crept into my storyboard file, but they were what was crashing the app so hard that the phone had to restart. I removed those lines from my main project and everything worked again.

like image 125
Chase Roberts Avatar answered Nov 01 '22 21:11

Chase Roberts


This error can be caused by executing a loop repeatedly. In my case it was a 'for' loop in which I reset the counting variable. As soon as I added an NSLog in the loop it was obvious.

like image 43
Peter B. Kramer Avatar answered Nov 01 '22 22:11

Peter B. Kramer


I just faced the same problem. I don't know if that will help you, but I also think it's coming from the Storyboard:

In my case, the problem is coming from a UITextView. Whenever I try to change the default text inside it, I have this error. If I let the default text or leave it empty, the app works fine. Making an IBOutlet and changing the text programmatically works as well.

I tried with other UI elements, but only the UITextView seems to have this issue.

like image 4
Remy Cilia Avatar answered Nov 01 '22 20:11

Remy Cilia


I have struggled with exact same error. Through a process of elimination I established that it had nothing to do with the any class but had to do with the storyboard. Luckily I keep regular backup copies and I tried to compare storyboards to establish what I had done - but could find nothing obvious. The backup copy worked fine and I was able to copy my controller classes (from the faulty copy with the changes) into the backup copy and they worked fine.

I think there is a bug possibly in storyboards.

like image 1
Jeremy Andrews Avatar answered Nov 01 '22 20:11

Jeremy Andrews