15

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'

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Hannibal
  • 151
  • 1
  • 4

6 Answers6

28

Deleting the build folder worked for me.

Johannes Bittner
  • 3,503
  • 2
  • 23
  • 21
3

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

3

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.

guozqzzu
  • 839
  • 10
  • 12
0

had to go to this path '/Users/alshammari/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/' and delete everything

falshammari
  • 1
  • 1
  • 1
  • 1
0

In my case I have SPM subdirectory in my project which had its own .build folder. I had to remove it, and problem gone

Alexey Lysenko
  • 1,890
  • 2
  • 12
  • 28
0

With flutter, i deleted the build ordner. Works fine now!

Sami
  • 1
  • 1