title: XCode + Swift: Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffee99cdfd8)
body: <p>I've seen a few posts on here about the same Thread 1 warning, however nothing that's specific to my code (or at least not that I can see).</p>
  <p>The error is: Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffee99cdfd8)</p>
  <p>The issue is: neither the XCode builder or preview are working, making it quite impossible to build. The @main is where the error crops up in the App view.</p>
  <pre><code>import SwiftUI
  
  @main
  struct WApp: App {
      var body: some Scene {
          WindowGroup {
              ContentView()
          }
      }
  }
  </code></pre>
  <p>Here is the content view code:</p>
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      var body: some View {
          ZStack {
              LinearGradient(gradient:  Gradient(colors: [.blue, .white]), startPoint: .topLeading, endPoint: .bottomTrailing)
                  .edgesIgnoringSafeArea(.all)
              
              VStack {
                  Text(&quot;California&quot;)
                      .font(.system(size: 32, weight: .medium, design: .default))
                      .foregroundColor(.white)
                      .padding()
                  
                  VStack(spacing:7) {
                  Image(systemName: &quot;cloud.sun.fill&quot;)
                      .renderingMode(.original)
                      .resizable()
                      .aspectRatio(contentMode: .fit)
                      .frame(width:180, height:180)
                  
                  Text(&quot;76°&quot;)
                      .font(.system(size:70, weight: .medium))
                      .foregroundColor(.white)
              }
                  HStack{
                      VStack(spacing:7) {
                      Text(&quot;Tuesday&quot;)
                              .font(.system(size: 20, weight: .medium, design: .default))
                              .foregroundColor(.white)
                              
                      Image(systemName: &quot;cloud.sun.fill&quot;)
                              .renderingMode(.original)
                              .resizable()
                              .aspectRatio(contentMode: .fit)
                          frame(width:40, height:40)
                      
                      Text(&quot;74°&quot;)
                              .font(.system(size: 20, weight: .medium, design: .default))
                              .foregroundColor(.white)
                              
                  }
                  }
                  
                  Spacer()
                  
                  
              
              }
          }
          
      }
  }
  
  struct ContentView_Previews: PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  </code></pre>
  <p>Any help would be great. I've tried refactoring in case the length of the code is the issue, which hasn't worked. Thanks.</p>