I keep getting the same 'Failed to build ContentView.swift error every time I open Xcode

As the title suggests, every time I open a new or old project on xCode I keep getting the 'failed to build ContentView.swift error.

when I click on the info button the following appears:

"file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/lib/swift/shims/Visibility.h' has been modified since the module file '/var/folders/0q/_h1zyvxd6cd7plpw0gjdsy3w0000gn/C/clang/ModuleCache/1GS1IUNF6IO19/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed"

any suggestion on how to fix this? As I have uninstalled and reinstalled Xcode to no avail.

Answered by Attilakalel in 699291022

deleted this in terminal and it worked. rm /var/folders/0q/_h1zyvxd6cd7plpw0gjdsy3w0000gn/C/clang/ModuleCache/1GS1IUNF6IO19/SwiftShims-2TTN5UXQBRCCQ.pcm

Me too, but I downgraded to 13.2 The problem is fixed

tried the previous version of Xcode still not working.

Accepted Answer

deleted this in terminal and it worked. rm /var/folders/0q/_h1zyvxd6cd7plpw0gjdsy3w0000gn/C/clang/ModuleCache/1GS1IUNF6IO19/SwiftShims-2TTN5UXQBRCCQ.pcm

I keep getting the same 'Failed to build ContentView.swift error every time I open Xcode
 
 
Q