Using Xcode 12 create a new Swift Package
Add a simple view with a preview to that swift package (See code below)
Attempt to run the preview.
See errors
Code:
Code Block #if os(iOS) import SwiftUI @available(iOS 14.0, *) public struct TestView: View { public init() { } public var body: some View { Text("Hello World") } } @available(iOS 14.0, *) struct NoDataView_Previews: PreviewProvider { static var previews: some View { TestView() } } #endif
Error:
Code Block Build input file cannot be found:...TestPackagePreview.o' (in targ SchemeBuildError: Failed to build the scheme "TestPackagePreview" Build input file cannot be found: ...TestPackagePreview.o' (in target 'TestPackagePreviewTests' from project 'TestPackagePreview' Link TestPackagePreviewTests (x86_64): error: Build input file cannot be found: ...TestPackagePreview.o' (in target 'TestPackagePreviewTests' from project 'TestPackagePreview')
Note I have added "..." in file paths for privacy reasons