jaggerwang/zqc-app-demo

Building release version for iOS failed

Closed this issue · 4 comments

When I try to build a release version for iOS, the following error occurred:

Undefined symbols for architecture i386:
  "___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 i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

screen shot 2017-03-08 at 1 26 21 pm

, I tried to upgrade ReactNative to latest version (0.42.0) but didn't help.

I also tried to build release version for vanilla React Native project (generated by react-native init AweSomeProject), it worked properly, so there might be something wrong in the libraries used here, e.g. react-native-wechat, react-native-video etc.

@jaggerwang would you please take a look?

Do you use Xcode to package? Which version? And a screenshot will be very helpful.

Yes I used latest Xcode, here is it:
screen shot 2017-03-09 at 9 45 51 am

and running on latest macOS:
screen shot 2017-03-09 at 9 47 27 am

this is how I switched to Release:
screen shot 2017-03-09 at 9 46 27 am

here is the output:
screen shot 2017-03-09 at 9 49 44 am

You need choose "Gneric iOS Device" when build.

Still got the same error even with Generic iOS Device:
screen shot 2017-03-10 at 12 44 51 am
,

But then I googled and realized that this is already an open issue for RN, and there is a workaround for it, so I did what suggested (add -lc++ to Other Linker Options for the test target) and fixed the problem.

Thanks for your time anyways!
Maybe this should be listed in Known Issues?