Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPRiskMagnes has been changed back to a dynamic Framework #920

Closed
mrtnlst opened this issue Jan 13, 2023 · 7 comments
Closed

PPRiskMagnes has been changed back to a dynamic Framework #920

mrtnlst opened this issue Jan 13, 2023 · 7 comments

Comments

@mrtnlst
Copy link

mrtnlst commented Jan 13, 2023

Integration Details:

  • Braintree SDK Version: 5.19.0

Describe the bug
In Release 5.8.0 you changed the PPRiskMagnes to dynamic framework:

This version of PPRiskMagnes replaces the dynamic framework/xcframework with a static framework/xcframework

On the most current one (5.19.0 and 6.0.0-beta) it has changed back to be a dynamically linked framework. Has this happened by accident? Is it possible that you change it back in a future release?

To Reproduce
I checked the current version 5.19.0's PPRiskMagnes binary with file in Terminal:

$ file /…/braintree_ios-5.19.0/Frameworks/XCFrameworks/PPRiskMagnes.xcframework/ios-arm64/PPRiskMagnes.framework/PPRiskMagnes
> /…/braintree_ios-5.19.0/Frameworks/XCFrameworks/PPRiskMagnes.xcframework/ios-arm64/PPRiskMagnes.framework/PPRiskMagnes: Mach-O 64-bit dynamically linked shared library arm64

@scannillo
Copy link
Contributor

👋 Hi @mrtnlst. Thank you for opening this issue.

So a few things: in v5.8.0 we did switch to a static framework of Magnes. In v5.16.0, we updated Magnes back to a dynamic framework, unknowingly. This was our mistake for not documenting and something we will be sure to clearly document in the future and test prior to shipping.

In retrospect, we believe these changes should have more properly been versioned as breaking changes, since Carthage merchants who include the Magnes binary directly would need to change its embed settings.

In the meantime - we are working to get static versions of Magnes and Cardinal binaries from our partners. We will keep you posted on when and how those are available for release.

It would be helpful though if you could give more context on how your app pulls in Braintree and your use case for static v dynamic frameworks. Thanks!

@mrtnlst
Copy link
Author

mrtnlst commented Jan 13, 2023

@scannillo Thank you for the quick response. It does break in a weird way in a project where we include Magnes (through PayPalDataCollector) with Swift Package Manager. It does work while debugging, but crashes in the Simulator mentioning, that the dylib can't be found.
We may be able to fix this issue in a different way, but we were wondering why PPRiskMagnes is a dynamic framework again. It's good to hear, that this was probably a mistake and we hope it comes back soon 🤞🏻

@mrazam110
Copy link

Looks like the similar issue?

I produced the issue with Braintree 5.19.0 and BraintreeDropIn 9.8.0 with SPM
I am using BraintreeApplePay, BraintreePayPal and BraintreeDataCollector.

Screenshot 2023-01-18 at 2 03 52 PM

@scannillo
Copy link
Contributor

@mrtnlst It does break in a weird way in a project where we include Magnes (through PayPalDataCollector) with Swift Package Manager. It does work while debugging, but crashes in the Simulator mentioning, that the dylib can't be found.

Thanks for confirming that this also breaks your SPM integration. I imagine if you remove and then re-install the Braintree Swift Package, this issues will resolve. Can you confirm?

@mrtnlst this was probably a mistake and we hope it comes back soon 🤞🏻

So switching between dynamic and static frameworks is indeed a breaking change, as you have experienced. It was our mistake in v5.8.0 to include a static version of PPRiskMagnes without making a major version bump. What we'll do is update the release notes of 5.16.0 to clarify that this version reverts back to the expected dynamic framework type for major version V5 of braintree_ios.

In the next major version V6, which is currently in beta, we will go forward with static framework binaries. We are still working to get these from our partners and will cut a V6 beta release with the updated static frameworks as soon as possible.

@scannillo
Copy link
Contributor

@mrazam110 - That looks like a different issue. Please open a new issue and fill out the template with steps to replicate.

@mrtnlst
Copy link
Author

mrtnlst commented Jan 19, 2023

@scannillo We found the culprit in our project that lead to the crash. Nevertheless we're looking forward for it being a static framework in v6.0 😄 Thanks again for the fast replies!

For anyone that faces a similar issue, here is what was wrong in our project:

Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/PPRiskMagnes.framework/PPRiskMagnes
Referenced from: <DB835515-233A-3F7F-A9E6-1F29FF0B0167> /Users/USER/Library/Developer/CoreSimulator/Devices/F38F8F32-F55A-4AEF-8DDB-314E1C274621/data/Containers/Bundle/Application/8549A289-F159-42E5-88E2-DE3C3F0391E1/<App Name>.app/<App Name>
Reason: tried: '/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/PPRiskMagnes.framework/PPRiskMagnes' (errno=2), '/usr/lib/swift/PPRiskMagnes.framework/PPRiskMagnes' (errno=2, not in dyld cache), '/Users/USER/Library/Developer/CoreSimulator/Devices/F38F8F32-F55A-4AEF-8DDB-314E1C274621/data/Containers/Bundle/Application/8549A289-F159-42E5-88E2-DE3C3F0391E1/Frameworks/PPRiskMagnes.framework/PPRiskMagnes' (errno=2), '/Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/
(terminated at launch; ignore backtrace)

Apparently our project was setup universal (as a Mac app) and then changed back to an iOS App. The setting build setting
LD_RUNPATH_SEARCH_PATHS remained at @executable_path/../Frameworks thought. For iOS Apps it needs to be @executable_path/Frameworks though. For some reason it launched when debugging with Xcode, but not after opening it just in the Simulator. Adjusting the path fixed our crash.

@mrtnlst mrtnlst closed this as completed Jan 19, 2023
@scannillo
Copy link
Contributor

👋 The v5.16.0 release notes have been updated to call out the switch back to a dynamic framework. V6 will move to static frameworks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants