PCH was compiled with module cache path error
Asked Answered
A

8

18

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'

Ably answered 17/7, 2019 at 16:26 Comment(0)
K
35

Deleting the build folder worked for me.

Kline answered 1/9, 2020 at 4:25 Comment(2)
This happened with me when re-created my react-native project in a different folder and then moved to a different path. This answers helped me.Jackpot
for me the build folder was inside the project's root folder, under the name .build. in order to see it I had to run ls -ld .?* at project's root folder to search for hidden files and foldersMisconceive
B
5

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.

Bosco answered 19/8, 2021 at 9:39 Comment(1)
Deleting the DerivedData worked for me, thanksMonogyny
T
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

Theater answered 22/8, 2019 at 1:18 Comment(0)
K
1

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

Kosel answered 27/11, 2022 at 7:31 Comment(0)
K
1

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

Kingery answered 2/12, 2022 at 9:26 Comment(2)
i am using ionic, where should i find this build folder?Diaphony
else, going to try the 'delete derived data folder'Diaphony
A
1

swift package reset did it for me

Amylopsin answered 8/5 at 18:28 Comment(0)
H
0

When i change my project path, i get the same problem. I deleted the flutter_project_name/build and flutter_project_name/ios/DerivedData, then it's working for me.

Hip answered 10/10, 2023 at 12:4 Comment(0)
B
0

If you're working in a Kotlin Multiplatform project, don't forget to delete the YourProject/shared/build folder!

Belated answered 28/2 at 9:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.