stripe / stripe-react-native

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

[IOS] Undefined symbols for architecture x86_64 #582

Closed ghost closed 2 years ago

ghost commented 3 years ago

Describe the bug I'm trying to integrate stripe into a react native application, when I install @stripe/stripe-react-native I receive the following error:

Undefined symbols for architecture x86_64: "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) "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) "(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) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I already followed the step from readme to remove swift related entries into library search paths (but I found only 1 without any reference to swift 5 version).

I'm using:

Mac OS Big Sur 11.4 XCode 12.5 @stripe/stripe-react-native 0.2.1 react-native 0.64.2

I also tested with react-native 0.65.1 with the same result.

I created a test repository for reproducing the error:

https://github.com/fl-matteoboleso/StripeTest

You can test with following command:

npm install cd ios pod install npm run ios

In this case I receive this error related to deployment target of "boost-for-react-native"

/Users/matteo/workspace-test/StripeTest/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'boost-for-react-native' from project 'Pods')

If I correct this error setting IOS Deployment target = 11.0 from xcode to this specific module the running command end with

Undefined symbols for architecture x86_64

Thanks

SeongwoonHong commented 2 years ago

hey man

Describe the bug I'm trying to integrate stripe into a react native application, when I install @stripe/stripe-react-native I receive the following error:

Undefined symbols for architecture x86_64: "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) "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) "(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) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I already followed the step from readme to remove swift related entries into library search paths (but I found only 1 without any reference to swift 5 version).

I'm using:

Mac OS Big Sur 11.4 XCode 12.5 @stripe/stripe-react-native 0.2.1 react-native 0.64.2

I also tested with react-native 0.65.1 with the same result.

I created a test repository for reproducing the error:

https://github.com/fl-matteoboleso/StripeTest

You can test with following command:

npm install cd ios pod install npm run ios

In this case I receive this error related to deployment target of "boost-for-react-native"

/Users/matteo/workspace-test/StripeTest/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'boost-for-react-native' from project 'Pods')

If I correct this error setting IOS Deployment target = 11.0 from xcode to this specific module the running command end with

Undefined symbols for architecture x86_64

Thanks

hey man, could you please share how you were able to solve this? I'm getting the same error but stuck on solutions

PujanShah22 commented 2 years ago

Same. How did you resolved this?