I've created a Widget and I'm adding @main
on top of the declaration.
However, when I switch to the Widget extension target and run it, I get the error 'main' attribute can only apply to one type in a module
because I also have a @main
in my main app file (the entry point).
I need to, depending on whether I want to run the app or the widget target, remove the @main
from the target that I don't want to run, run it and later on add it.
Is there something I'm doing wrong? I have tried to look this up and I haven't found any mention of it.
Thanks in advance!