Cannot Preview in This File -- Message Send Failure

XCode 13 SwiftUI Cannot preview in this file - Message send failure for update

I managed to fix this by wrapping the ContentView() call in the preview in a ZStack. This is a known bug caused by @FocusState when used in a top-level view that the preview window is rendering.

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ZStack {
ContentView()
}
}
}

Credit: https://developers.apple.com/forums/thread/681571?answerId=690251022#690251022

Xcode 12 & SwiftUI: Cannot preview in this file — Failed to update preview

Apparently it was a bug with Firestore, which is most likely the cause: XCode 12 Preview Crashes when adding Firebase SDK Swift UI 2.0. The best solution at this point is to call, pod update which should solve the issue. I verified on Xcode 12, iOS 13+.

Xcode 13 will not show Preview

I had the same problem and found a solution here:
https://developer.apple.com/forums/thread/691237

I was not signed in to GitHub so as suspected, it does not play a role.

It seems Xcode got in to an invalid state. I suspect that simply disabling and enabling automatic signing would resolve the issue but I also cleared the Container folder for my project as suggested in the post.



Related Topics



Leave a reply



Submit