13.8 C
New York
Friday, October 18, 2024

ios – App crashes on actual machine on account of “Library not loaded” error when utilizing a customized framework and StripeTerminal


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:

  1. Create a brand new workspace in Xcode 16.
  2. Add a brand new app challenge (App1) and a framework challenge (MobileCore) to the workspace.
  3. Add the StripeTerminal package deal to MobileCore as a dependency utilizing SPM.
  4. Add StripeTerminal to Frameworks and Libraries and Hyperlink Binary with Libraries for MobileCore.
  5. Try to import StripeTerminal in MobileCore.
  6. 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?

enter image description here
enter image description here

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles