I’m trying to build my react native project on a Mac Intel, but keep getting the next error:
Showing All Messages
Undefined symbol: _swift_stdlib_isStackAllocationSafe
Undefined symbols for architecture arm64:
"_swift_stdlib_isStackAllocationSafe", referenced from:
function signature specialization <Arg1 = Owned To Guaranteed> of function signature specialization <Arg[0] = [Closure Propagated : closure #1 (__C.SKProduct) -> Swift.Bool in closure #2 (Swift.Set<__C.SKProduct>) -> () in PurchasesCoreSwift.IntroEligibilityCalculator.checkTrialOrIntroductoryPriceEligibility(with: Foundation.Data, productIdentifiers: Swift.Set<Swift.String>, completion: (Swift.Dictionary<Swift.String, __C.NSNumber>, Swift.Optional<Swift.Error>) -> ()) -> (), Argument Types : [Swift.Set<Swift.String>]> of generic specialization <__C.SKProduct> of Swift._NativeSet.filter((A) throws -> Swift.Bool) throws -> Swift._NativeSet in libPurchasesCoreSwift.a(IntroEligibilityCalculator.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried almost all the answers on: link.
Also
pod deintegrate
pod install
pod repo update
My react-native version:
"react-native": "0.64.2"
The Architecture of my project:
The link binary With Libraries
UPDATE
I also updated the react native version to 0.67.4 but still not working.
5
Answers
For react-native 0.67+: After a lot of research, I found the next solution from Vegaro:
SOLUTION LINK
First step is to upgrade the react-native-purchases by Revenuecat package to the latest version.
Clean your pods: REFERENCE LINK TO PROPERLY CLEAN PODS
Declare a pods post install process: Add the next to your Podfile:
And finally, change the Library Search Paths in the project manually (XCode). Remove:
Add:
Clean your project and run the: "Archive" build again.
As a workaround downgrade to Xcode 13.2.1 works for me. On this version everything is ok.
But at the version 13.3 – I have this issue
If it is feasible for you to do so, update your React Native version. Version 0.67 fixes this issue.
If updating is not an option, the easiest solution is to update your Library Search Paths.
Select your project in Xcode, and go to "Build Settings". Scroll down until you see "Search Paths", and finally, "Library Search Paths".
Replace
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"
with"$(SDKROOT)/usr/lib/swift"
.Credit for this solution goes to Vegaro, who posted it HERE, along with what I’d consider to be a more invasive option if this doesn’t work for you.
I had a similar issue on my M1 Mac and here is what I did to fix this:
brew install watchman
if you don’t have node =>
brew install node
sudo arch -x86_64 gem install ffi
cd ios/ && arch -x86_64 pod install
.run Xcode with Rosetta.
.
You can install Rosetta by running:
softwareupdate --install-rosetta
exclude architecture arm64.
clean build – open xcode then press Command + Shift + K
nvm
try to replaceNODE_BINARY=node
with the actual result of thewhich node
command, which in my case looks something like this:Shoutout to these answers:
one two three
It works for me when I upgraded xcode to 14.1.