Swift UI Preview is not working on any of the sample projects

I’m getting the following error. I’m running xCode 11.3.1. Have tried restarting xCode, deleting derived data, etc with no success. Does anyone have a workaround for this.

CrashOnLaunchError: RGBullsEye app crashed on launch

The app “RGBullsEye” crashed while updating the preview. Look for crash logs in ~/Library/Logs/DiagnosticReports for more details.

==================================

| Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 “The request to open “com.raywenderlich.RGBullsEye” failed.” UserInfo={BSErrorCodeDescription=RequestDenied, NSLocalizedDescription=The request to open “com.raywenderlich.RGBullsEye” failed., NSUnderlyingError=0x7fbb50ac1f90 {Error Domain=NSPOSIXErrorDomain Code=89 “Operation canceled”}, FBSOpenApplicationRequestID=0x57dc, NSLocalizedFailureReason=The request was denied by service delegate (SketchBoard.SketchBoardSystemService).

I found this on SO:

This error happens when a previous run of the app is still alive in the background, even if you clicked “Stop” in Xcode. Try manually killing the app in simulator itself: cmd+shift+H twice to open up running apps, drag up your app to kill it. Note cmd+shift+H is the shortcut to go to homescreen. Then start the new run and it should work fine :slight_smile:

Something else I’ve found that can help with mysterious crash-on-open is to delete .xcodeproj/xcuserdata/.xcuserdatad