Build started to fail in xcode

So I was working on my new project and when I tried to build it in xcode it failed. Tried many things to make it work with no success, wasted 2 days now.

Then I tried to build my previous project, the one that worked fine before and it started to show the same error, but only if I first build it in Unity and then xcode.
If I build the xcode project that I built in Unity about 1 month ago, the project still builds fine in xcode.
I haven’t updated anything in Unity/xcode/macOS so I’m not sure how could it break.

Here’s the error I’m getting in xcode, there are no errors when I build/export in Unity.

Could not find or use auto-linked library ‘swift_StringProcessing’
Could not find or use auto-linked framework ‘UnityMediationTrackingService’
Could not find or use auto-linked framework ‘UnityMediationInstantiationService’
Could not find or use auto-linked framework ‘UnityMediationS2SService’
Undefined symbol: Foundation.URL.path(percentEncoded: Swift.Bool) → Swift.String
Undefined symbol: _objc_msgSend$failWithError:usingBufferObject:
Undefined symbol: _objc_msgSend$invokeBufferedObjects
Undefined symbol: _objc_msgSend$setOperation:
Undefined symbol: _objc_msgSend$putBufferObjectIntoTheQueue:
Undefined symbol: _objc_msgSend$callInvokerWithOperation:withCompletion:andErrorCompletion:

There are many lines with Undefined after that but they probably have the same reason, so I’m cutting the error message.

Googled it, tried a few different things, but no luck.
Given that xcode still successfully builds the xcode project that was made 1 month ago, I’m guessing that something has changed in Unity and it builds something different, not the same result as before, but I’m not sure where to start the research.
Could it be that Unity downloads something during the build time and this “something” is not the same as before?

xcode 13.4.1
Unity 2021.3.11f1
Unity Mediation, Purchases etc .
I don’t think I’m using any components that can update on their own.

I would appreciate any advice.

I have same issue, only thing is that we use cloud build, but error message is same. Still no answer as well. Here is thread .

I noticed that the size of the .xcworkspace file is much smaller now, the project with 95KB builds fine, the project with 13KB fails. Wonder what’s missing.

Hi there, could you please try changing to Xcode 14.1.0 and Ruby 2.7.4 on your configuration, perform a clean build and let us know about the result?

Kind regards,

Updated Xcode 14.1.0 and Ruby 2.7.4, re-built got an error
Protobuf’ does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE)

Had to set Enable_Bitcode to NO for the main target and the build was successful!

Huge thanks @jlemosz.5954937