Check that you are opening Runner.xcworkspace instead of Runner.xcodeproj in Xcode. I had that error that I mistakenly opened the wrong file in Xcode.
Runner.xcworkspace
Runner.xcodeproj