The issue I was facing when I received this error was, I had opened the wrong file in Xcode. Instead of opening the *.xcworkspace file, I opened the *.xcodeproj file.
The solution to this issue is to open the *.xcworkspace file in Xcode instead of the *.xcodeproj file.