Search code examples
swiftuixcode11xcode11.1

SwiftUI Preview displays error - Cannot preview in this file -- current target needs adjusted build settings


I'm using Xcode 11.1 and all of my swift previews show the following errors:

swiftui preview pane error

Cannot preview in this file -- current target needs adjusted build settings

along with

"ProjectTests.xctest' failed to get build settings: unsupportedProductType("com.apple.product-type.bundle.unit-test", <Xc..."

Clicking the diagnostics button generates the following popup:

enter image description here

Open file has supported build settings "ProjectTests.xctest" failed to get build settings: unsupportedProductType("com.apple.product-type.bundle.unit-test", <Xcode3TargetProduct:0xblahblahblahProjectTests.xctest blueprint:< Xcode3Target:0xblahblahProjectTests>>)

My previews still render fine, but is there some way to remove this error?


Solution

  • This error no longer exists in Xcode Version 11.2 (11B52).