title: SwiftUI - contextMenu on LazyVGrid cell causing animation crash when Map present
body: <p>I have a LazyVGrid and a NavigationBarItem button that changes the number of columns. It cycles through 1, 2, 3 then back to 1, etc. I use the <code>.animation(.default)</code> modifier to animate this change. When there is just one column I use a different cell structure that includes a small Map element. I have a contextMenu that works fine for 2 and 3 columns but crashes instantly when used on the single-column cell.</p>
  <blockquote>
  <p>AnimationError[2652:855376] [Unknown process name] CGImageCreate: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast</p>
  </blockquote>
  <p><strong>This crash occurs only on my iPhone 11 Pro real device</strong>, the simulators handle it fine. If I remove the animation, all is good.</p>
  <p>A compilable, stripped-down version:</p>
  <pre><code>import SwiftUI
  import CoreLocation
  import MapKit
  
  struct HillMO: Identifiable {
      let id = UUID()
      let name: String
      let latitude: Double
      let longitude: Double
  }
  
  struct ContentView: View {
      
      @State private var gridLayout: [GridItem] = [GridItem(), GridItem(), GridItem()]
      
      var body: some View {
          NavigationView {
              VStack {
                  GeometryReader { geometry in
                      ScrollView {
                          LazyVGrid(columns: gridLayout, alignment: .center, spacing: 8) {
                              ForEach(hills) { hill in
                                  Cell(hill: hill, width: geometry.size.width, columns: gridLayout.count)
                                      .contextMenu {
                                          Button(action: { }) { Label(&quot;Bingo&quot;, image: &quot;eyeglasses&quot;) }
                                          Button(action: { }) { Label(&quot;Bungo&quot;, image: &quot;hourglass&quot;) }
                                      }
                              }
                          }.padding(5)
                          .animation(.default)
                      }
                  }
              }
              .navigationBarTitle(&quot;Bagger&quot;)
              .navigationBarItems(
                  trailing: HStack {
                      Button(action: {
                          gridLayout = Array(repeating: .init(.flexible()), count: gridLayout.count % 3 + 1)
                      }) {
                          Image(systemName: &quot;circle.grid.3x3&quot;)
                      }
                  }
              )
          }
      }
      
      let hills = [ HillMO(name: &quot;un&quot;, latitude: 0.0, longitude: 0.0),
                    HillMO(name: &quot;dau&quot;, latitude: 1.0, longitude: 1.0),
                    HillMO(name: &quot;tri&quot;, latitude: 2.0, longitude: 2.0),
                    HillMO(name: &quot;pedwar&quot;, latitude: 3.0, longitude: 3.0),
                    HillMO(name: &quot;pump&quot;, latitude: 4.0, longitude: 4.0),
                    HillMO(name: &quot;chwech&quot;, latitude: 5.0, longitude: 5.0)
                  ]
  }
  </code></pre>
  <p>My Cell and CellMap Views:</p>
  <pre><code>struct Cell: View {
      
      var hill: HillMO
      var width: CGFloat
      var columns: Int
      
      var body: some View {
          Group {
              if columns != 1 {
                  ZStack {
                      Rectangle()
                      Text(hill.name).foregroundColor(.white)
                  }
              } else {
                  ZStack {
                      Rectangle()
                      HStack {
                          Text(hill.name).foregroundColor(.white)
                          Spacer()
                          CellMap(coordinateRegion: MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: hill.latitude, longitude: hill.longitude),
                                                                       latitudinalMeters: 300000,
                                                                       longitudinalMeters: 300000))
                              .frame(width: (width / CGFloat(columns)) * 0.24, height: (width / CGFloat(columns)) * 0.24)
                              .clipShape(Circle())
                      }
                  }
              }
          }
          .frame(height: (width / CGFloat(columns)) * (columns == 1 ? 0.25 : 1.25))
      }
  }
  
  struct CellMap: View {
      
      @State var coordinateRegion: MKCoordinateRegion
      
      var body: some View {
          Map(coordinateRegion: $coordinateRegion)
      }
  }
  </code></pre>