ios - 构建 react native 应用程序时 : undefined symbols for architecture gxx_personality_v0

标签 ios react-native

我只是按照 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/

相关文章:

javascript - babel-preset-react-native 和高阶组件

react-native - react-native 中的 SVG 图像

react-native - 如何禁止RN的WebView跳转到浏览器?

ios - 删除/编辑 ALAssetsLibrary 中的专辑组,可以吗?

ios - 当 dataSource 数组正确时 UICollectionView 出现 "Index Out Of Range"错误

ios - 根据标题文本内容自动调整按钮大小

javascript - 使用 firebase 身份验证和 firestore 添加用户

reactjs - 带点参数的 React Native 组件名称

IOS 项目在 xcode 7.1 上显示错误 "An internal error occurred. Editing functionality may be limited"

ios - 如何集成 iAd 或 Admob 横幅,如弹出窗口(非全屏),但它在应用程序的屏幕中心显示为弹出窗口?