iOS game crashing when using Unity Ads

When launching my game, it crashes, and the logs indicate the issue is:

dyld: Library not loaded: @rpath/libswiftCore.dylib

To resolve this, I added the following line to my post-build process:

project.SetBuildProperty(frameworkTargetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");

I imagine this would fix the crash because of this, but it causes another problem during Cloud Build:

Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'.

In summary:

  • If I enable ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to fix the crash, Cloud Build fails with the above error.
  • If I disable it, the build uploads successfully, but the game crashes on launch.

This creates a frustrating cycle where fixing one issue leads to the other. How can I fix both problems in Unity Cloud Build?