I’ve constructed a model new workspace in Xcode 16 with the next setup:
- A challenge containing an app named “App1”.
- A separate challenge for a customized framework named “MobileCore” that features reusable lessons for different apps in my workspace.
- The workspace makes use of Swift Bundle Supervisor (SPM) for dependencies.
Dependencies:
- App1 makes use of Firebase.
- MobileCore makes use of StripeTerminal.
I’ve added StripeTerminal as a dependency for MobileCore utilizing SPM. It seems in Frameworks and Libraries beneath MobileCore’s goal, and additionally it is added to Hyperlink Binary with Libraries.
Downside:
Once I construct and run App1 from Xcode, it really works high quality on the simulator. Nevertheless, once I construct and deploy it to a actual machine, it crashes with the next error:
dyld[5040]: Library not loaded: @rpath/StripeTerminal.framework/StripeTerminal
Steps to Reproduce:
- Create a brand new workspace in Xcode 16.
- Add a brand new app challenge (App1) and a framework challenge (MobileCore) to the workspace.
- Add the StripeTerminal package deal to MobileCore as a dependency utilizing SPM.
- Add StripeTerminal to Frameworks and Libraries and Hyperlink Binary with Libraries for MobileCore.
- Try to import StripeTerminal in MobileCore.
- Construct and run App1 on an actual machine.
The app crashes with the next error:
dyld[5040]: Library not loaded: @rpath/StripeTerminal.framework/StripeTerminal
Extra Particulars:
What I’ve Tried:
- I confirmed that StripeTerminal is correctly added to Hyperlink Binary with Libraries.
- I verified that the Runpath Search Paths embrace
@executable_path/Frameworks
and@loader_path/Frameworks
. - The app works on the simulator however fails on the machine, indicating it’s a runtime linking concern.
Query:
What may very well be inflicting this concern, and the way can I repair the lacking library error when deploying to an actual machine?