Cannot preview in this file, failed to launch

I am not able to use swiftUI preview in my project. i have attached the diagnosed report for the same. Please update.

Welcome to the forum.

Could you show:

  • how you call preview
  • the code for the View to preview

import SwiftUI

struct SwiftUIView: View { var body: some View { Text("Hello, World!") } }

#Preview { SwiftUIView() }

Here is the snippet, it is not even loading for printing "Hello, World!"

Does this project happen to use EXCLUDED_ARCHS=x64_64 on any targets? If so, that launch failure might indicate a bug that was discovered with Xcode version 15.2 and 15.3. Otherwise, if you could generate the full preview diagnostics and file a Feedback Request, we can take a look at the full diagnostics. You could also look for any crash reports in ~/Library/Logs/DiagnosticReports for you app as a starting point (our full diagnostics would contain these if they exist).

Hi, Here is the attachment for excluded architecture

Checked it setting the optimization level as Onone , not worked for me.

I have already attached a diagnosis report as not able to upload a .zip of all the build logs also patched the report as text here. Please have a look and update about the fix.

Here is the feedback request :- https://feedbackassistant.apple.com/feedback/13708209

Cannot preview in this file, failed to launch
 
 
Q