I'm using Xcode 12.4. After making some changes to a class (to be precise, I changed the data type of a function argument), I ran into this problem. I've never faced this error before. Doing a clean (Product -> Clean) helped me resolve this problem. Hope this helps someone.