Skip to main content

Missing Required Module SwiftShims Error

·1 min

I recently migrated to a new Mac. On the new Mac I’m using an external SSD as the startup disk instead of the internal hard drive. To keep the SSD from filling up with things like photos, music, and iOS apps, I moved my user folder to the internal hard drive.

This moving of the user folder away from the startup disk caused problems when I tried to build existing Xcode projects. I would get the following errors:

Missing required module SwiftShims.

PCH was compiled with module cache path OldPath but the path is currently NewPath.

Where OldPath used my old user folder location and NewPath used the new location.

I first tried to clean the project and rebuild it, but the problem persisted. A similar question on Stack Overflow showed many answers. A promising one was to find a SharedPrecompiledHeaders folder and delete it. The problem was I couldn’t find this folder on my computer.

The solution for me was to go to my DerivedData folder and delete the ModuleCache folder. I hope this helps someone who has a similar problem.