after introducing a macros-dependent swift package into my project, swiftui previews started to fail with the same error and the following diagnostic description:
[targetMissingUserApproval] Target [MACRO NAME HERE] must be enabled before it can be used.)
i fixed this issue locally by
heading to the issue navigator aka the exclamation mark in the triangle within xcode’s left sidebar,
tapping on the “macro target [MACRO NAME HERE] must be enabled…” warning, and
tapping trust & enable on the system alert that popped up.
after following these steps, i was once again able to build swiftui previews on xcode 15.4. i hope this fix works for others whose projects utilize (directly or indirectly) macros!