For me this problem appeared while trying to run an app on an iOS device (first appeared after adding a package, but persisted after removing the package dependency). I tried many things, but what finally resolved it was deleting the contents of the Xcode DerivedData directory. (I.e. Xcode -> Settings -> Locations, open DerivedData in Finder and delete its contents.)