I have an Xcode project which was downloaded from the internet so I don\'t know which Xcode version was used to write it but the language is Swift 2. I opened it in Xcode 7.
The same happened to me and it was solved by cleaning the project. However, if you cleaned it —as you say you did—, I would try closing and reopening Xcode. Even though it seems stupid, it works more often than not.
I had the same issue. My solution was to do the following
That got it working for some reason...
Update to XCode 7.1.1 from 7.1 solved my problem.
With XCode 7.1 I used Airman00's solution but suddenly it stop working.
Hope it helps!
Had to add a step Airman00's answer.
That got it working for some reason...
Possible solution for those struggling with the above answers.
If you've just restored your machine from a time machine backup (migrating from old to new machine), you may want to re-install Xcode.
It doesn't appear to bring the caches or other important settings across properly from the time machine restore.
I've just taken that; what appears to be a drastic step, but it's worked!
Instructions on how to do so: Completely reinstall Xcode 9
-W
If you have this type of error in your project then follow these steps:
This will successfully resolve the error.