Upgrade to React Native 0.62.2 iOS error: Undefined symbol _swift_getFunctionReplacement
Question
When upgrading React Native from 0.61.5 to 0.62.2, Xcode compiles with errors:
Undefined symbols for architecture x86_64:
"_swift_getFunctionReplacement", referenced from:
_swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o)
(maybe you meant: _swift_getFunctionReplacement50)
"_swift_getOrigOfReplaceable", referenced from:
_swift_getOrigOfReplaceable50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o)
(maybe you meant: _swift_getOrigOfReplaceable50)
Solution
We can set Dead Code Stripping to YES.
In Xcode, select PROJECT-> Build Settings-> LInking-> Dead Code Stringpping, set to YES, and then recompile.