Help request - ERROR: You can’t use this version of the application 'CitySights' with this version of macOS

Hey everyone :wave:

I’m running into a strange issue with my app in Xcode Previews. It crashes with the error:

“You can’t use this version of the application ‘CitySights’ with this version of macOS.”

However, when I run it in the simulator, everything works fine — no crash. I think apple may have updated my computer over night as all the apps I previously built with code with Chris started crashing.

I also started on the football app and it crashed when I was implementing the API call in the same way.

System Info:

  • macOS: 15.3.2 (24D81)
  • Chip: Apple M1 Pro
  • Xcode: 16.2

If I comment out the task with the API Call on this line, the crash goes away in Preview. I tried printing out statements in the API call and it doesn’t look like the api call happening before the crash.

Would love any insight if you’ve run into this before or just generally if anyone has any suggestions for how to handle network calls in Previews more gracefully :pray:

Thanks!
Jade

Ok so I fixed it, or maybe it fixed itself?

I updated the preview to take the the instance of the business model

#Preview {
var businessModel = BusinessModel()
ContentView()
.environment(businessModel)
}

Also deleted all the derivedData from this directory to clear out anything that might be messing with preview ~/Library/Developer/Xcode/DerivedData/

Restarted the computer, picked a different simulator and its working :woman_shrugging: