inAppPaymentSDK error in iOS

I have implemented SquareInAppPaymentsSDK in my iOS project using objective C. I have added the SDK manually and the version is 1.6.4. But when trying to run the project I am getting the below error:

dyld[1318]: Library not loaded: @rpath/CorePaymentCard.framework/CorePaymentCard
Referenced from: <2B09E165-084F-36C2-94FD-D7E01BC2F051> /private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/SquareInAppPaymentsSDK.framework/SquareInAppPaymentsSDK
Reason: tried: ‘/usr/lib/swift/CorePaymentCard.framework/CorePaymentCard’ (no such file, not in dyld cache), ‘/private/preboot/Cryptexes/OS/usr/lib/swift/CorePaymentCard.framework/CorePaymentCard’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/CorePaymentCard.framework/CorePaymentCard’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/CorePaymentCard.framework/CorePaymentCard’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/CorePaymentCard.framework/CorePaymentCard’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/CorePaymentCard.framework/CorePaymentCard’ (no such file)Library not loaded: @rpath/ThreeDS_SDK.framework/ThreeDS_SDK
Referenced from: /private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/SquareBuyerVerificationSDK.framework/SquareBuyerVerificationSDK
Reason: tried: ‘/usr/lib/swift/ThreeDS_SDK.framework/ThreeDS_SDK’ (no such file, not in dyld cache), ‘/private/preboot/Cryptexes/OS/usr/lib/swift/ThreeDS_SDK.framework/ThreeDS_SDK’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/ThreeDS_SDK.framework/ThreeDS_SDK’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/ThreeDS_SDK.framework/ThreeDS_SDK’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/ThreeDS_SDK.framework/ThreeDS_SDK’ (no such file), ‘/private/var/containers/Bundle/Application/2A7A9DDC-A664-4079-8F84-3041ED443F55/MassageClub.app/Frameworks/ThreeDS_SDK.framework/ThreeDS_SDK’ (no such file)

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build on iOS: Point of Sale API
Enable Secure Remote Commerce - iOS
Download, Configure, and Run the Client Sample

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

The error message indicates that the CorePaymentCard.framework and ThreeDS_SDK.framework are not found. These are dependencies of the SquareInAppPaymentsSDK.

When you manually add the SquareInAppPaymentsSDK to your project, you also need to ensure that all its dependencies are correctly added.

Here are the steps to resolve this issue:

  1. Open your Xcode project.
  2. Select your target, then go to the “General” tab.
  3. Scroll down to the “Frameworks, Libraries, and Embedded Content” section.
  4. Click the “+” button to add a new framework.
  5. In the dialog that appears, find and add CorePaymentCard.framework and ThreeDS_SDK.framework.
  6. Make sure that these frameworks are set to “Embed & Sign”.

After following these steps, try to build and run your project again. The error should be resolved.

This answer was reviewed by @Bryan-Square.