Here is what I did after spending 2 days trying to fix this.
- Clean the Build
Menu Bar → Product → Clean
- Delete Derived Data
Delete Xcode Preferences
defaults delete com.apple.dt.Xcode
make sure your build setting are on new build setting instead of legacy build setting.
I can't be sure what worked exactly and what happened in the background, but it worked for me.