I just now started having the exact same issue. The build runs fine on a physical device and simulator, but I cannot archive it to send to TestFlight.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: