XCode 13 build fails: input file R.generated.swift was modified during the build

After updating to XCode 13, I keep getting this error randomly while building/running the project.

error: input file R.generated.swift was modified during the build

The error goes away after cleaning the project and building/running, but after a couple of builds/runs the error happens again.

Any ideas what's wrong and how to fix this?

There is no file named R.generated.swif in the standard Xcode project. I guess you are using some sort of third party framework. If so, you should better contact to the author of the framework or find a community site for it.

XCode 13 build fails: input file R.generated.swift was modified during the build
 
 
Q