Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PCH was compiled with module cache path error

I changed the name of my username and home folder for my Mac and now when I try building a new project I get an error during the compiling process. How would I correct this?

I already cleaned the build folder

:0: error: PCH was compiled with module cache path '/Users/edgarmartinez/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/2Y7VT4EKQOHHI', but the path is currently '/Users/hannibalmartinez/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/2Y7VT4EKQOHHI'

:0: error: missing required module 'SwiftShims'

like image 371
Hannibal Avatar asked Jul 17 '19 16:07

Hannibal


3 Answers

Deleting the build folder worked for me.

like image 70
Johannes Bittner Avatar answered Sep 21 '22 00:09

Johannes Bittner


I found that changing the derived folder name like alyoshak mentioned in the answer I have linked to worked. If you go Xcode Preferences->Locations then change "DerivedData" to "DerivedData2" and switch the dropdown to relative that should make a new folder and then when you hit build it should fix your issue. https://stackoverflow.com/a/34188668

like image 44
Todd Rederburg Avatar answered Sep 18 '22 00:09

Todd Rederburg


When i move the project ABAdressbook to another directory, I got the following error:

PCH was compiled with module cache path
 '/Users/guo/Desktop/Guo/ABAdressbook/DerivedData/ModuleCache.noindex/3D6110VGP95KX'
, but the path is currently 
'/Users/guo/Documents/Projects/ABAdressbook/DerivedData/ModuleCache.noindex/3D6110VGP95KX'

Its a bit different form @Hannibal but all look like the file path is the key.

As my error point to DerivedData, so i delete this folder and rebuild it. This error disappeared.

like image 45
guozqzzu Avatar answered Sep 18 '22 00:09

guozqzzu