I tried the various things suggested here and none of them fixed the problem for me. What did fix it was to disable Bitdefender's ransomware protection. Then I could do my builds and they worked just fine. So if you use Bitdefender, give that a try.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: