No macro named 'Preview' - error

So I am trying to move an old project from ios16 to ios17... wanted to play around with the new previews, and animations and first error I get is the above.

When I create a new project I can use the macro just fine.

What is more: when I add a new swiftUI file I get the same error with the #Preview macro.

I went through the project and target settings, making sure everything is set to ios17 and Swift5, but can't find any other settings. Cleared the build cache and rebuilt from scratch.

Hoping someone else ran onto the same problem and found a solution?

Without using #Preview

...everything compiles just fine and I can run the app on my phone

I forgot to mention that code completion was working.

I fiddled around some more: I created a new project, imported all the files (all but the @main App file) and the error appeared, again. On the ContentView file from the template!

I tried to import the files one by one, but I got crazy with all the dependecy errors I get, some seem to be importable without invalidating said macro.

And no, I did not redefine the macro in any file, or anything :/

So I'm hoping someone else runs into the same problem with easier code and will try to work without previews on this project. Or use the old content_providers.

check if you have import UIKit for me this import resolve

No macro named 'Preview' - error
 
 
Q