Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined-symbols-for-architecture-x86_64-on-ios after adding Stripe React Native #599

Closed
gbmahili opened this issue Sep 20, 2021 · 15 comments

Comments

@gbmahili
Copy link

Describe the bug
I am getting the following error when I run the app in Release mode.
undefined-symbols-for-architecture-x86_64-on-ios

That error is documented here but it only fixes the issue in the Debug scheme, not in the Release scheme.

That same fix is also documented here but also fix the issue in the Debug scheme, not the Release scheme.

To Reproduce
Steps to reproduce the behavior:

  1. Install a new React Native app
  2. Add Stripe as instructed in the Getting started documentation
  3. Open your project via Xcode, go to project -> build settings, find library search paths and remove all swift related entries such as: $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) and $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME).
  4. Create a new Swift file to the project (File > New > File > Swift), give it any name (e.g. Fix.swift), and create a bridging header when prompted by Xcode.
  5. Run the app in Debug scheme (From your XCode, go to Product > Scheme > Edit Scheme) and choose Run on the left and select Debug in the right pane, do the same for Test
  6. Run the app
  7. The app will build successfully
  8. Repeat step 5 but change Debug to Release then run the app, Build will fail with error undefined-symbols-for-architecture-x86_64-on-ios

Expected behavior
The app should build successfully in the Release scheme just like how it is building successfully in the Debug Scheme.

Screenshots
Screen Shot 2021-09-20 at 8 00 28 AM

Smartphone (please complete the following information):

  • Device: iPhone 11 Pro Max Simulator
  • OS: 14.5
@arekkubaczkowski
Copy link
Collaborator

arekkubaczkowski commented Oct 4, 2021

@gbmahili have you removed those library search paths entries both for debug and release mode?
Zrzut ekranu 2021-10-4 o 11 58 06

@michaelbayday
Copy link
Collaborator

also getting this issue and these entries are not within my repo

@michaelbayday
Copy link
Collaborator

❌  Undefined symbols for architecture x86_64
> Symbol: _OBJC_CLASS_$_RCTEventEmitter
> Referenced from: type metadata for stripe_react_native.StripeSdk in StripeSdk-a3ebf5d1e464abf21f2a5d95fac11bff897a445930bcdef1f62aed67246f0d19.o

@arekkubaczkowski
Copy link
Collaborator

arekkubaczkowski commented Oct 6, 2021

@michaelbayday what version of react-native and library are you using?
Assuming that you went trough all of the points form troubleshooting section list, there are couple more things to check:

  • make sure that the platform :ios version in your Podfile is 11 at least
  • above mentioned version is consistent with this specified in your XCode settings:

Zrzut ekranu 2021-10-6 o 08 17 29

Are you having this issue within debug or release schema?

@insteptech
Copy link

insteptech commented Dec 29, 2021

same issue:

need help

Screenshot 2021-12-29 at 1 01 18 PM

@iranaahsanali
Copy link

I have the same issue.

@DanielDanaee
Copy link

Any updates on this?

I have the same issue

same issue:

need help

Screenshot 2021-12-29 at 1 01 18 PM

@Eli-Nathan
Copy link

Same issue, tried all the options with clearing Library Search paths to just have the inherited value and creating the empty swift file for create the bridging header but i'm still getting this problem.
Xcode 13
RN 0.64.1
@stripe/stripe-react-native 0.8.0

@metinjakupi
Copy link

Any update on this issue?
I have the same issue

@Eli-Nathan
Copy link

I may have found a solution. The README's troubleshooting guide wasn't exactly right in my case.

It said to remove the swift entries from the library search paths.

But I had to remove everything and just leave the inherited value. See screenshot below.

You could also head to your [Project name].pbxproj file and find references to LIBRARY_SEARCH_PATHS and make sure they only have the inherited value in them there.

I have 4 references to LIBRARY_SEARCH_PATHS in the file and I made them all look like this:

LIBRARY_SEARCH_PATHS = "$(inherited)";

and now it works!

Screenshot 2022-07-19 at 10 43 57

@metinjakupi
Copy link

@Eli-Nathan Do you have MPB M1 or Intel?

@Eli-Nathan
Copy link

Eli-Nathan commented Jul 19, 2022

@metinjakupi
I had an Intel chip up until last week so I was able to test on that and it worked 😄

I now have an M1 and as long as i'm running Xcode in rosetta mode then it works there too

@metinjakupi
Copy link

@Eli-Nathan I also have M1. I will try with rosetta thanks!

@metinjakupi
Copy link

This solution fixed my issue
facebook/react-native#31941 (comment)

@charliecruzan-stripe
Copy link
Collaborator

If you're using an M1, the above comment from @metinjakupi should resolve things for you!

Otherwise, this comment contains the correct solution (which is also mentioned in our readme :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants