Cannot Preview in SwiftUI in Xcode 13

Hello, I am following the instructions for the iOS App Dev Tutorial. Specifically, the "Scrumdinger" project.

However, I keep receiving the error

NoBuildableEntriesError: active scheme does not build this file

I have all my files saved to my Downloads Folder so that it is not connected to iCloud Drive. I'm not sure how to fix this and have looked at many forums.

I have:

  • restarted Xcode
  • restarted my computer
  • moved my files off iCloud
  • repeated the steps in the instructions

and I still cannot find a solution to this error

Hi,

Sorry to hear you are having problems getting previews working. It might be worth trying to move the project out of the Downloads folder as it does have some special security rules that might be affecting things.

If that still doesn't resolve issue then probably best next step will be to file a feedback with diagnostics. We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.

If you are having issues with macOS, catalyst or on-device iOS previews then download and install the logging profile for your device. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift Attach the sysdiagnose to the bug report as well as the diagnostics using the instructions below.

Then when you get an error in Xcode Previews, an error banner appears in the canvas

  1. Click the "Diagnostics" button in that banner (or if the banner is missing you can use the menu: Editor > Canvas > 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)

I think this might be related to Xcode's installation path, and how iCloud interacts with folders like Downloads. None of the suggestions I've seen around resolved this but it's now consistently working for me after I moved Xcode into Applications. It was in Downloads and I never realized since I keep it pinned.

Cannot Preview in SwiftUI in Xcode 13
 
 
Q