stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.12k stars 981 forks source link

Crash on iOS 12.4.8 because Stripe SDK requires SwiftUI #1828

Closed tjarksaul closed 3 years ago

tjarksaul commented 3 years ago

Summary

When running an app with the Stripe SDK on iOS 12.4.8 (latest iOS for iPhone 6) the app crashes on launch because it requires SwiftUI:

dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
  Referenced from: /private/var/containers/Bundle/Application/14E4D763-C793-491B-A7CA-95478E70F5AE/CarSharing.app/Frameworks/Stripe.framework/Stripe
  Reason: image not found

Code to reproduce

See above

iOS version

12.4.8

Installation method

Cocoapods

SDK version

21.4.0

Other information

n/a

davidme-stripe commented 3 years ago

Hello @tjarksaul, thanks for filing this! Which version of Xcode are you running? There was a known issue in Xcode 11 which caused SwiftUI.framework to be linked incorrectly, but it should be fixed in Xcode 12. I'm trying to reproduce this in Xcode 12.2 and 12.5, and I'm unable to do so.

tjarksaul commented 3 years ago

Hello @david-stripe, I am using Xcode 12.5.

SentoCrespo commented 3 years ago

+1 to this @david-stripe

Also happening in Xcode 12.5.1

We do not have SwiftUI in our project, not even linked (iOS 12 does not support it though)

SarannyaSalim commented 3 years ago

+1 @davidme-stripe

Facing same issue.

davidme-stripe commented 3 years ago

Sorry for the trouble — we still can't reproduce this locally, but we'll update the Podspec to forcibly weak-link SwiftUI. We plan to release this update within the next few days.

SentoCrespo commented 3 years ago

Thank you @david-stripe

We'll try as soon as it's out and let you know the outcome.

davidme-stripe commented 3 years ago

The update was delayed by a few days. In the meantime, I've pushed a workaround to this branch:

pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git', :branch => 'weak-swiftui'

Please try it out and let me know if it resolves the issue. Thanks!

jaytrisw commented 3 years ago

@da-stripe I installed from this branch and it seems to be good to go! Thank you for your efforts here!

SentoCrespo commented 3 years ago

Same here, thanks for the fast response & fix.

Cheers @david-stripe !

SentoCrespo commented 3 years ago

When can we expect this to be merged @david-stripe ? We always want to keep our Stripe dependency updated to the last version and not a specific branch :)

Thanks again!

davidme-stripe commented 3 years ago

We released this in version 21.7.0.