stripe-react-native: undefined-symbols-for-architecture-x86_64-on-ios after adding Stripe React Native
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:
- Install a new React Native app
- Add Stripe as instructed in the Getting started documentation
- 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)
. - 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.
- 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
- Run the app
- The app will build successfully
- 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
Smartphone (please complete the following information):
- Device: iPhone 11 Pro Max Simulator
- OS: 14.5
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15
same issue:
need help
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 toLIBRARY_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:and now it works!
@gbmahili have you removed those library search paths entries both for debug and release mode?