title: “Cannot preview in this file - Connection interrupted: send previewInstances message to agent" error in Xcode 12
body: <p>I've got a UIKit project and I'm slowly trying to move to SwiftUI, I created a SwiftUI file and I tried to preview it but I'm getting this error:</p>
  <blockquote>
  <p>Cannot preview in this file - Connection interrupted: send previewInstances message to agent</p>
  </blockquote>
  <p>This is my SwiftUI File:</p>
  <pre><code>import SwiftUI
  
  struct LineChart: View {
      var body: some View {
          Text(&quot;Hello, World!&quot;)
      }
  }
  
  struct LineChart_Previews: PreviewProvider {
      static var previews: some View {
          LineChart()
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/KjxKJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KjxKJ.png" alt="Screenshot of error" /></a></p>
  <p>I only saw one similar question on StackOverFlow but that didn't help either, is there anyway that I could fix this? Appreciate the feedback!</p>