Library not loaded: @rpath/CorePaymentCard.framework/CorePaymentCard is the error that keeps popping up on me. I have used CocoaPods to install SquareInAppPaymentsSDK, and it builds, but as soon as it launches it crashes.
I have done all that needs to be done according to Square’s documentation, including the Run Script Phase:
SETUP_SCRIPT=${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"/SquareInAppPaymentsSDK.framework/setup"
if [ -f "$SETUP_SCRIPT" ]; then
"$SETUP_SCRIPT"
fi
Any ideas why I’m STILL getting this?
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
Download, Configure, and Run the Client Sample
Build on iOS: In-App Payments SDK
Install the In-App Payments SDK
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 you’re encountering typically occurs when the required framework isn’t properly linked to your project. Here are a few steps you can take to troubleshoot:
-
Ensure that SquareInAppPaymentsSDK.framework
is included in your project’s “Embedded Binaries” and “Linked Frameworks and Libraries” sections. You can find these in your project’s target settings.
-
Make sure that the Run Script Phase for the Square In-App Payments SDK is the last phase in the list. This is important because the order of build phases matters. The Run Script Phase for the Square SDK should be after the ‘Embed Frameworks’ phase.
-
Double-check that the CorePaymentCard.framework
is included in the SquareInAppPaymentsSDK.framework
. You can do this by navigating to the SquareInAppPaymentsSDK.framework
in Finder and checking its contents.
-
Clean your project (Product → Clean Build Folder) and try to build and run your project again.
If you’ve checked all these and you’re still encountering the issue, it might be a problem with your Xcode environment or project configuration.
This answer was reviewed by @Bryan-Square.