App crashes at runtime when attempting new way of declaring Previews in iOS 17

Hello everyone. I'm pretty new to developing for iOS, I just started a couple of weeks ago, so apologies if I don't use the correct terminology on certain occasions. I also did attempt to search both these forums, as well as the change log for iOS 17 Developer Beta 3 to see if this was a known issue, and I didn't see anything reporting it, so again, apologies if this is known. I was just posting this because, being new, I didn't want to jump to the conclusion that It was an issue with the compiler. I actually already jumped the gun once and submitted a Feedback ticket where an Image was rendering just fine in the Preview of Xcode, but not on device, and was told that it was my code 🤦, so I'd rather not have a repeat 😅.

As I'm sure most of you have seen, iOS 17 allows a much shorter way to declare previews:

#Preview {
    ContentView()
}

Compared to the previous way in iOS 16 and before:

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

However, when I attempt to run my code, if any of my Views are using the new method of declaring Previews, the app will crash immediately at runtime with the following error:

dyld[583]: Symbol not found: _$s21DeveloperToolsSupport17UVPreviewRegistryCMn
  Expected in:    /System/Library/Frameworks/DeveloperToolsSupport.framework/DeveloperToolsSupport

I have tested this with a brand new project on both an iPhone XR and an iPhone 14 Pro. It actually worked on iOS 17 Beta 1, but ceased working on Beta 2, and still does not function on Beta 3. The only constant is the device that I physically do the developing, my MacBook, as I remember seeing a message about it copying over symbols to each device before it would let me remotely deploy or preview my code to either of my phones, so if this isn't an issue with the betas, I wonder if it could be related perhaps to that. Let me know if you have experienced anything similar!

Again, super sorry if this has been reported on already. If you just want to point me in the right direction, then I'll do the reading! Thanks!

Hi @StellarAelwyd, are you running the same beta version (3, based on your post) of Xcode and OS on the device you're trying to preview on?

@Developer Tools Engineer Wow thanks. I feel like an ***** 😂. I didn't even think about the possibility of Xcode not updating automatically since I didn't get it from the App Store.

You are a hero man ! I was getting a crash when running my app then you made me remember using iOS 17 beta 1 then switched to beta 2 !! Insane just commented #Preview and everything is back to normal !

App crashes at runtime when attempting new way of declaring Previews in iOS 17
 
 
Q