Preview won't load on Mac-OS/Multiplatform Swift-App

Hey,

I wanted to create a Mac-OS application. Normally I only code iPhone apps. But as soon as I want to display anything on the preview, it loads, just as normal, and then the throbber/progress indicator disappears and the preview canvas stays gray like it used to be before. I also don't get any error messages. Only one time after trying different things I got one message saying: "Could not launch Preview Shell." and "Could not create FBSOpenApplicationService." I also searched for a few solutions and tried some but none of them seemed to work. In the DiagnosticReports were some files of the time but I didn't seem to find anything helpful in there and they don't appear when I reopen my project or switch from PreviewMode "My Mac" to "iPhone 16 Pro".

When I launch the app on a simulator it works perfectly fine but this is quite annoying.

Thanks for trying to help me!

Hi,

Sorry to hear you are having problems getting previews working. This error can often indicate a crash in your application when it launches, or a problem with the simulator. If you look into the folder ~/Library/Logs/DiagnosticReports, do you see any crash reports for your app?

If not, the best next step will be to file a feedback with diagnostics so we can take a look.

We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.

Install the logging profile using instructions available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift On your mac running Xcode, and on your physical preview device (if you are using one).

Install the logging profile using the following instructions on your mac running Xcode; and if you are using one, your physical preview device (iOS or visionOS): https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift

Then when you reproduce the problem in Xcode:

  1. Either (a) an error banner will appear, click the "Diagnostics" button in that banner; or (b) if you're not seeing an error but you still want to provide diagnostics you can get the same diagnostics window by going under the Editor menu in the menu bar, then selecting the Canvas submenu, then selecting "Diagnostics".
  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)
  4. Generate a sysdiagnose on your mac and any on-device preview devices, and attach those too
Preview won't load on Mac-OS/Multiplatform Swift-App
 
 
Q