I was getting this same error, then eventually also got the error mentioned in this other question/answer. After following the suggestion in this answer, the error seems to have gone away:
Solution 1:
Delete the following directory:
/Users/john/Library/Developer/Xcode/DerivedData/name-of-app-gfofxrkhgcfgcfecjrnbbgyowlnf
I later got the same error where this first solution didn't work. This time the following solution worked instead:
Solution 2:
Recursively set the permissions to 777 for this directory:
chmod -R 777 /Users/john/Library/Developer/Xcode/DerivedData/name-of-app-gfofxrkhgcfgcfecjrnbbgyowlnf