Cannot preview - Active scheme does not build file

I don’t understand what I need to do to see the preview file. I create a new project and expect to see the preview, but it only says “Cannot preview in this file - active scheme does not build this file” Am I missing something? The preview has worked before, but it seems to be hit and miss.

Try to quit Xcode and then or even shut down your Mac or try to go into safe boot

I restarted my computer and it started working. This will be very annoying if I have to do that every time. Thanks for the help.

Try to Update to the latest verion or report a bug in Xcode, App Developer