Search code examples
swiftxcodeapple-watch

Applewatch: segue crashing app in Xcode 14.2


I build an AppleWatch standalone app some months ago. I worked fine, but after running Xcode 14.2 segues don't work anymore. It crashes the app.

See the video with Xcode and the simulator showing the problem: https://youtu.be/LlgnZ68JUe8

I removed the segues. Added them again. Same result.

Does anyone have the same experience and knows how to work around this?

This is the crash log:

2023-01-25 18:29:31.297044+0100 radioNED[68275:936119] [default] -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]:3229: Couldn't instantiate class _TtC34radioNEDWatchOS_WatchKit_Extension14MenuController
2023-01-25 18:29:31.297175+0100 radioNED[68275:936119] [default] -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]:3230: Critical failure. Simulating crash: Condition failed:"NO". Couldn't instantiate class _TtC34radioNEDWatchOS_WatchKit_Extension14MenuController
CoreSimulator 857.14 - Device: Apple Watch Series 8 (45mm) (B8446BC6-7125-4A3F-874E-FD58549E6BD3) - Runtime: watchOS 9.1 (20S75) - DeviceType: Apple Watch Series 8 (45mm)

I dived deeper into the problem and found out that a target is partly missing". In the attached video I compare an old backup of my project before opening it in Xcode 14.x and the one after importing it some months ago: https://youtu.be/FoevyCoyayg

How did this happen? And how can I fix this?


Solution

  • After upgrading to Xcode 14.2 Xcode asked to update the project for the new version of Xcode. The radioNEDWatchOS WatchKit Extension target/module disappeared, but both UIViewControllers that crashed were still in the radioNEDWatchOS WatchKit Extension target/module.

    enter image description here

    I changed the module to radioNED and everything works fine now.

    enter image description here