stripe-react-native: iOS: Fails when I try install the dependency

I try to install @stripe/stripe-react-native in ios, already run pod install in ios folder, but I’m getting this error

Any idea?

image

Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 17 (2 by maintainers)

Most upvoted comments

I found the issue on my build.

I was a bit puzzled by the troubleshoot step of removing entry from LIBRARY_SEARCH_PATHS, because when I looked at my Xcode project no such path existed.

But I do see the paths there… however just not in the entry. Screen Shot 2021-05-21 at 10 52 06 PM

What I did is to open the xcode project file with an editor and just search for LIBRARY_SEARCH_PATHS, and remove the entire thing from it. This is what I saw.

LIBRARY_SEARCH_PATHS = (
  "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
  "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
  "\"$(inherited)\"",
);

remove

   "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
  "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",

Once thats removed the build started to work

it’s already described here https://github.com/stripe/stripe-react-native#troubleshooting

Correct, it just wasn’t clear it had to be done via an editor instead of using Xcode, since via Xcode the entry did not show up.

it’s already described here https://github.com/stripe/stripe-react-native#troubleshooting

library search paths doesn’t work. You need to change it manually by editing the Xcode project file. can you update the README please? I did not get the paths in the library search paths list in the Xcode.

I tried to implement on a fresh project with rn init. this is 64.1, with Xcode 12.5, deployment target 11

plain implementation with out bridging header build generates 9 errors

after implementing the bridging header there are 5 errors

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)

Here are my specs

    OS: macOS 11.3.1
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 3.12 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7042882
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.1 => 0.64.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

This is the library search path listed Screen Shot 2021-05-21 at 5 02 41 PM