我只是按照 React Native 文档来构建应用程序以在设备上运行或发布它 [1]。
我遇到了以下错误,即使是在全新的 React native 应用程序上也是如此。该应用程序在模拟器中运行良好。
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)
我基本上在做
react-native init SampleApp
... generates app
react-native run-ios # works fine (on simulator)
react-native run-ios --configuration Release # fails with the error above.
如果我打开 XCode 项目,将 Scheme 更改为 Release,然后尝试构建,同样会失败。
这是怎么回事?看起来我错过了一个图书馆?我如何检查它在那里? (我是 React Native 和 iOS 的新手,所以不要以为我知道很多:)
谢谢!
--
[1] https://facebook.github.io/react-native/docs/running-on-device.html
最佳答案
我有这个确切的错误并通过这些说明解决了它:
我只是通过在 Xcode 中删除和创建我的方案来解决此问题(信用转至此 SO 帖子)。这是我在 Xcode 7.3.1 中所做的:
Open your project in Xcode.
Click Product > Scheme > Manage Schemes.
Select the scheme for your project, then click the minus (—) near the
bottom left to delete it.
Now click the plus (+) to create a new scheme for your project.
这就是我所要做的,hth :)
关于ios - 构建 react native 应用程序时 : undefined symbols for architecture gxx_personality_v0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41771537/