I got a similar error trying to add a View to the sample code project for “Building a SignalGenerator”.
(https://developer.apple.com/documentation/avfaudio/audio_engine/building_a_signal_generator)
I was using Xcode 13.4.1 and MacOS 12.5. The code runs i.e. produces audio successfully but with an error message “Previews not supported for SignalGenerator”
UnsupportedProductTypeError: Previews not supported for SignalGenerator
HumanReadableSwiftError
CreationError: noBuildExecutor
Previews can be defined in applications, frameworks, Swift packages, or dynamic libraries
productType = com.apple.product-type.tool
buildable = SignalGenerator