Error in Xcode when trying to create a Release build of my newly created React Native 0.39.2.
Undefined symbols for architecture arm64:
"___gxx_personality_v0", referenced from:
_RCTDefaultLogFunction_block_invoke in libReact.a(RCTLog.o)
_RCTFormatLog in libReact.a(RCTLog.o)
___RCTAddLogFunction_block_invoke in libReact.a(RCTLog.o)
_RCTPerformBlockWithLogFunction in libReact.a(RCTLog.o)
_RCTPerformBlockWithLogPrefix in libReact.a(RCTLog.o)
RCTGetLocalLogFunction() in libReact.a(RCTLog.o)
___RCTPerformBlockWithLogPrefix_block_invoke in libReact.a(RCTLog.o)
...
ld: symbol(s) not found for architecture arm64
react-native init NewProject
Go to Xcode and change build scheme to "Release".
Build/Run
Removing the NewProjectTests folder seems to remove the symptom, but this is probably not a good solution!
Make sure -lc++ is added to Other linker flags for your primary and test target. This solved the issue for me.
Adding Linker Flag
Follow @justinsherwood said.
Notice: Set the configuration to both target 'xxxx' and target 'xxxxTest'.
Most helpful comment
Make sure -lc++ is added to Other linker flags for your primary and test target. This solved the issue for me.
Adding Linker Flag