Alberto Alcini
Alberto Alcini

Reputation: 71

How to solve "Undefined symbols for architecture x86_64" on NSScanner? Swift pod in react-native

I recently created a stripe integration in react-native. I updated the stripe ios sdk from objective C to the latest full swift sdk, but now I got this when I build it and I don't really know how to solve it.

I already put the "Dummy" swift file, not error related to swift files whatsoever despite this one:

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

XCode: 12.2 (latest)

Stripe IOS SDK: 21.0.1 (latest)

React-native: 0.63.4 (latest)

I already tried creating a pure swift project (non react-native) to test the stripe sdk and it works...

Thanks

Upvotes: 2

Views: 3307

Answers (1)

Alberto Alcini
Alberto Alcini

Reputation: 71

Found it.

It was for a project -> https://github.com/Agaweb/react-native-stripe

The solution: Remove the swift-5.0 search path, or you will get an error about undefined symbols (try it if you don't believe me), do this -> https://github.com/react-native-community/upgrade-support/issues/62#issuecomment-622985723

Upvotes: 5

Related Questions