'main' attribute cannot be used in a module that contains top-level code

Hi! I'm having this issue that wasn't present before in this project.

In my app's entry file, which is named 'controlShiftApp.swift' and NOT 'main.swift' (which has been documented to cause the same error), the @main attribute gives the following error:

'main' attribute cannot be used in a module that contains top-level code

I have no other files named main.swift in this target. I only have main.swift in the targets for system extensions. I also haven't used @main anywhere else in this project. Here is a screenshot to show you what I mean.

I'd really appreciate inputs on this matter. I need to get this fixed so that I can continue my development ASAP. Also, I'm new to Swift so many things are not as trivial to me, and I would like it if you could give me clear steps on how to resolve this. Thanks!

@stilakid You should change name of file main.swift and you got no error for 'main attribute can't be used in module that contains top-level code.'

You cannot define the let persistenceController in this @main part.

'main' attribute cannot be used in a module that contains top-level code
 
 
Q