MessageSendFailure: Message send failure for update

Hello, while following the SwiftUI tutorial I keep getting this error (MessageSendFailure: Message send failure for update).

I am on Xcode: 13.2.1

Where can I submit the bug report?

Hi,

Sorry to hear you are having problems getting previews working.

Crash logs for the preview app will show up in ~/Library/Logs/DiagnosticReports/. It can sometimes take a few minutes for it to generate, so give it a bit time and then see if any are there. Hopefully that will give you some helpful hints on what is causing the crash.

Based upon your description of the situation I am guessing that the preview version of the app has some stale app data (perhaps an old version of a CoreData container that doesn't have migration support to the current version?). To start from a fresh slate you can use the terminal app and run xcrun simctl --set previews delete all.

If that still doesn't resolve issue then probably best next step will be to file a feedback with diagnostics. We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.

If you are having issues with macOS, catalyst or on-device iOS previews then download and install the logging profile for your device. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift Attach the sysdiagnose to the radar as well as the diagnostics using the instructions below.

Then when you get an error in Xcode Previews, an error banner appears in the canvas

  1. Click the "Diagnostics" button in that banner
  2. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  3. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)

I encountered a similar problem where Xcode didn't report any compilation error. Turns out there is a fatal error inside my code:

Slider(value: $data.lengthInMinutes, in: 5...3, step: 1) {
    Text("Length")
}

The code 5...3 will cause a fatal error. The following is the output from swift repl:

1> 5...3

Swift/x86_64-apple-macos.swiftinterface:5739: Fatal error: Range requires lowerBound <= upperBound

2022-03-04 00:46:48.810765+0800 repl_swift[97067:2558677] Swift/x86_64-apple-macos.swiftinterface:5739: Fatal error: Range requires lowerBound <= upperBound

Execution interrupted. Enter code to recover and continue.

Enter LLDB commands to investigate (type :help for assistance.)

Fix the code and the review will work again. So, you might want to double check your code to see if there are anything that will cause an error.

MessageSendFailure: Message send failure for update
 
 
Q