1

Every time I make a change in my code, an error shows up above the preview (Cannot preview this file - unexpected error occurred), and when I click "Run Diagnostics" it displays :

messageRepliedWithError("Connecting to launched interactive agent 22385", Optional(Error Domain=com.apple.dt.ultraviolet.service Code=17 "connectToPreviewHost: Failed to connect to 22385: (null)" UserInfo={NSLocalizedDescription=connectToPreviewHost: Failed to connect to 22385: (null)}))

After a couple of minutes, the preview works, and all is fine (until I make another change, and the same error shows up).

Any help would be greatly appreciated!

shim
  • 9,289
  • 12
  • 69
  • 108
PrayForTech
  • 353
  • 2
  • 10

1 Answers1

0

Disabling code signing fixed the issue for me for the error below

messageRepliedWithError("Connecting to launched interactive agent 11225", Optional(Error Domain=com.apple.dt.xcodepreviews.service Code=17 "connectToPreviewHost: Failed to connect to 11225: Error Domain=com.apple.dt.ProcessAttachUtilities Code=2 "Unable to create a RemoteBundleLoader; target is already invalid" UserInfo={NSLocalizedDescription=Unable to create a RemoteBundleLoader; target is already invalid}"

However, a similar error is still triggered as described in Xcode 11.1 SwiftUI Preview failing

Just Command+Option+P and patience for now.