How can I resolve these preview errors?

Sometimes when I reopen a project the component preview pane fails with the following error message:


NoBuildableEntriesError: active scheme does not build this file

Select a scheme that builds a target which contains the current file, or add this file to a target that is built by the current scheme.

How can I resolve this and prevent it from happening again?
How can I resolve these preview errors?
 
 
Q