9

I have Catalina macOS version (10.15) installed and still the canvas is not showing up.

The error message I get from Xcode is

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

2
  • Probably a stupid question, but did you check the Use SwiftUI checkbox when you created the project? Also, the error suggests the issue is related to your scheme? What file is it referring to? Commented Jun 6, 2019 at 21:41
  • For me, just a new vanilla iOS project with the SwiftUI checkbox checked. It creates ContentView.swift (which is a SwiftUI view). When this view is open, the preview pane on the right displays the error @BilalReffas quotes. Commented Jun 6, 2019 at 21:47

2 Answers 2

6
+100

I filled a Radar FB6123260 please do that also. For me resetting the nvram worked and deleting derived data.

Resetting Nvram

Deleting derived data:

rm -rf ~/Library/Developer/Xcode/DerivedData
Sign up to request clarification or add additional context in comments.

2 Comments

I deleted Derived data without resetting Nvram. It worked for me.
I deleted file with your command in terminal but I still get that error message from Xcode. You filled a Radar but I don't know how to do that. Please help me....
0

Add your new files to the compiled bundles as part of the build phases? Not only does the target need to be set for the file- but it also has to be included in the compiled bundles..

Project -> Target -> Build Phases -> search for the file your are trying to work on

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.