Preview Update Error: HumanReadableSwiftError CancellationError: CancellationError()

With the newest version of Xcode (15.3) I cannot get Preview to load and am getting the following error:

HumanReadableSwiftError CancellationError: CancellationError()

I'd had this same issue a few months ago and opening up an older project's previews and then opening the project I was working on would allow Preview to show.

The last few weeks I've not been getting this error and after 3 or 4 days not being in Xcode I'm getting this same error again.

I'm relatively new to Xcode and Swift so not being able to load the darn preview and work through tutorials after seemingly doing the exact same thing I've been doing for months is quite ridiculous and frustrating.

Any ideas on how to resolve this issue would be greatly appreciated.

Replies

Hi,

Sorry to hear you are having problems getting previews working. The best next step will be to file a feedback with diagnostics so we can take a look.

Steps to generate helpful diagnostics:

  1. Download and install the logging profile on all devices involved. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift
  2. Reproduce the issue
  3. Click the "Diagnostics" button in the error banner in Previews' Canvas area (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  4. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  5. Attach (or make from the folder) the resulting zip file to the bug report (will be named something like previews-diagnostics-0123456789.zip)
  6. Generate the sysdiagnose(s) and attach those too

Ok, it sound like a Voodoo trick, but

I always using my iphone device connected to Xcode during my preview (something with cable sometime wireless) .

  • Restarting Xcode didn't work

So what i did was:

  • Disconnect my iphone physically from my Mac also turn off wifi.
  • from Xcode i selected Ipad as a new target device

After a while Preview started to reload and now it works again.