stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.24k stars 256 forks source link

Xcode build error on React Native 0.65.1 #611

Closed takeerdevs closed 2 years ago

takeerdevs commented 2 years ago

Describe the bug Build not successful on React Native 0.65.1

To Reproduce Steps to reproduce the behavior:

  1. Initialize new react native project
  2. Install @stripe/stripe-react-native
  3. run pod install in project's ios folder
  4. Open project workspace in Xcode and build

Expected behavior For brand new project the build process should be successful

Screenshots Screenshot 2021-09-27 at 08 14 44

Error's in text format

Undefined symbols for architecture arm64:
  "protocol conformance descriptor for __C.NSOperationQueue : Combine.Scheduler in Foundation", referenced from:
      lazy protocol witness table accessor for type __C.NSOperationQueue and conformance __C.NSOperationQueue : Combine.Scheduler in Foundation in libStripe.a(URLSession+Retry.o)
  "type metadata accessor for (extension in Foundation):__C.NSOperationQueue.SchedulerTimeType", referenced from:
      closure #1 (Foundation.Data?, __C.NSURLResponse?, Swift.Error?) -> () in (extension in Stripe):__C.NSURLSession.stp_performDataTask(with: Foundation.URLRequest, completionHandler: (Foundation.Data?, __C.NSURLResponse?, Swift.Error?) -> (), retryCount: Swift.Int) -> () in libStripe.a(URLSession+Retry.o)
  "(extension in Foundation):__C.NSScanner.scanUpToString(Swift.String) -> Swift.String?", referenced from:
      static Stripe.STPPhoneNumberValidator.formattedRedactedPhoneNumber(for: Swift.String, forCountryCode: Swift.String?) -> Swift.String in libStripe.a(STPPhoneNumberValidator.o)
  "(extension in Foundation):__C.NSOperationQueue.SchedulerTimeType.init(Foundation.Date) -> (extension in Foundation):__C.NSOperationQueue.SchedulerTimeType", referenced from:
      closure #1 (Foundation.Data?, __C.NSURLResponse?, Swift.Error?) -> () in (extension in Stripe):__C.NSURLSession.stp_performDataTask(with: Foundation.URLRequest, completionHandler: (Foundation.Data?, __C.NSURLResponse?, Swift.Error?) -> (), retryCount: Swift.Int) -> () in libStripe.a(URLSession+Retry.o)
  "_swift_getOpaqueTypeConformance", referenced from:
      associated type witness table accessor for Body : SwiftUI.View in Stripe.PaymentSheet.PaymentButton<A> : SwiftUI.View in Stripe in libStripe.a(PaymentSheet+SwiftUI.o)
      associated type witness table accessor for Body : SwiftUI.View in Stripe.PaymentSheet.FlowController.PaymentOptionsButton<A> : SwiftUI.View in Stripe in libStripe.a(PaymentSheet+SwiftUI.o)
      associated type witness table accessor for Body : SwiftUI.View in Stripe.PaymentSheet.FlowController.ConfirmButton<A> : SwiftUI.View in Stripe in libStripe.a(PaymentSheet+SwiftUI.o)
      associated type witness table accessor for SwiftUI.ViewModifier.Body : SwiftUI.View in Stripe.PaymentSheet.PaymentSheetPresentationModifier : SwiftUI.ViewModifier in Stripe in libStripe.a(PaymentSheet+SwiftUI.o)
      associated type witness table accessor for SwiftUI.ViewModifier.Body : SwiftUI.View in Stripe.PaymentSheet.PaymentSheetFlowControllerPresentationModifier : SwiftUI.ViewModifier in Stripe in libStripe.a(PaymentSheet+SwiftUI.o)
      associated type witness table accessor for Body : SwiftUI.View in Stripe.ConfirmPaymentPresentationModifier<A, B> : SwiftUI.ViewModifier in Stripe in libStripe.a(STPPaymentConfirmation+SwiftUI.o)
  "__swift_FORCE_LOAD_$_swiftCoreMIDI", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe in libStripe.a(STPPaymentMethodGiropayParams.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe in libStripe.a(STPPaymentMethodAUBECSDebit.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe in libStripe.a(STPContactField.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe in libStripe.a(ApplePayHeaderView.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe in libStripe.a(BottomSheet3DS2ViewController.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe in libStripe.a(STPThreeDSLabelCustomization.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe in libStripe.a(ConfirmButton.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreMIDI_$_stripe_react_native, __swift_FORCE_LOAD_$_swiftCoreMIDI_$_Stripe )
  "__swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers", referenced from:
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(STPPaymentMethodGiropayParams.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(STPPaymentMethodAUBECSDebit.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(STPContactField.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(ApplePayHeaderView.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(BottomSheet3DS2ViewController.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(STPThreeDSLabelCustomization.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe in libStripe.a(ConfirmButton.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_stripe_react_native, __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_Stripe )
  "__swift_FORCE_LOAD_$_swiftCoreML", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe in libStripe.a(STPPaymentMethodGiropayParams.o)
      __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe in libStripe.a(STPPaymentMethodAUBECSDebit.o)
      __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe in libStripe.a(STPContactField.o)
      __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe in libStripe.a(ApplePayHeaderView.o)
      __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe in libStripe.a(BottomSheet3DS2ViewController.o)
      __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe in libStripe.a(STPThreeDSLabelCustomization.o)
      __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe in libStripe.a(ConfirmButton.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreML_$_stripe_react_native, __swift_FORCE_LOAD_$_swiftCoreML_$_Stripe )
  "__swift_FORCE_LOAD_$_swiftWebKit", referenced from:
      __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe in libStripe.a(STPPaymentMethodGiropayParams.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe in libStripe.a(STPPaymentMethodAUBECSDebit.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe in libStripe.a(STPContactField.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe in libStripe.a(ApplePayHeaderView.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe in libStripe.a(BottomSheet3DS2ViewController.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe in libStripe.a(STPThreeDSLabelCustomization.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe in libStripe.a(ConfirmButton.o)
      ...
     (maybe you meant: __swift_FORCE_LOAD_$_swiftWebKit_$_stripe_react_native, __swift_FORCE_LOAD_$_swiftWebKit_$_Stripe )
ld: symbol(s) not found for architecture arm64

My working environment MacOs: v11.2 (Big Sur) Node: v14.16.1 React Native: v0.65.1 @stripe/stripe-react-native: v0.2.2

takeerdevs commented 2 years ago

You can either let me know which version of react native does this plugin build successfully so we can downgrade because it does not work even if i create bridging header according to troubleshooting docs https://github.com/stripe/stripe-react-native#troubleshooting, Thanks.

nywooz commented 2 years ago

I fixed mine by adding what is suggested in this link https://github.com/stripe/stripe-react-native#troubleshooting

takeerdevs commented 2 years ago

@nywooz what react native version is your build process successful.. Screenshot 2021-10-01 at 08 05 43

i did exactly the same process in brand new react native project(0.65.1) and followed suggestion in here https://github.com/stripe/stripe-react-native#troubleshooting and build process failed, furthermore in brand new react native project i didn't see any entries relating to ../usr/swift.. in library search paths.. Thanks.

arekkubaczkowski commented 2 years ago

@takeerdevs you need to change project Settings rather than target ones

takeerdevs commented 2 years ago

I found the solution, suggested solution didn't work, you don't even have to remove swift related entries, all you have to do is change ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to Yes in Project->Build Settings

krunalshoppiko commented 2 years ago

I found the solution, suggested solution didn't work, you don't even have to remove swift related entries, all you have to do is change ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to Yes in Project->Build Settings

This one is also not working