XCode can't find SpriteKit?

This seems to be a pretty weird issue. I'm following along with a SpriteKit tutorial, and while I can build my project and run it on my phone, I keep getting this error in the IDE: Cannot load underlying module for SpriteKit

It says it cannot load the module but that's weird because SpriteKit should be a native framework that must've been installed with my XCode.

It is pretty annoying because XCode is not context-aware, and code completion doesn't work for any object that's derived from SpriteKit.

Here's my system info:
  • XCode version: Version 12.0 (12A7209)

  • MacOS version: MacOS Catalina 10.15.7 (19H2)

Is this a bug in XCode?

Accepted Answer

I did try cleaning the project and it didn't do anything. I had to restart XCode and that fixed the issue. Weird.

Answers

Have you tried "Clean Build Folder"?
What happens if you create a new SpriteKit project and run that, same error?
I did try cleaning the project and it didn't do anything. I had to restart XCode and that fixed the issue. Weird.