Have you had any luck figuring out what's causing this or how to avoid? It has been happening to me too. I try restarting Xcode but it keeps building over and over again. Eventually, randomly, it will complete, but it's such a huge waste of time waiting for it to stop!
I looked at the instructions for submitting diagnostics but got stuck because I don't know how to download and install the logging profile when for the preview canvas, and the problem doesn't apply to using a real device. In fact, does it even make sense to capture diagnostics for the device if the problem is with Xcode?