React-native: Xcode will not build release with React Native 0.39.2

Created on 14 Dec 2016  路  2Comments  路  Source: facebook/react-native

Description

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

Reproduction

react-native init NewProject
Go to Xcode and change build scheme to "Release".
Build/Run

Solution

Removing the NewProjectTests folder seems to remove the symptom, but this is probably not a good solution!

Additional Information

  • React Native version: 0.39.2
  • Platform: [FILL THIS OUT: iOS, Android, or both?]
  • Operating System: MacOS Sierra
  • Xcode: 8.2
Locked

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

All 2 comments

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'.

Was this page helpful?
0 / 5 - 0 ratings