ios - 架构 arm64 的 undefined symbol : _YGConfigNew in libyoga. a(Yoga.o)

标签 ios xcode react-native cocoapods

当我在 iOS 模拟器 中使用 XCodereact-native run-ios 启动我的应用程序时,它运行良好。

但如果我在真实设备中做同样的事情,它就不起作用了。我遇到了这个错误:

Undefined symbols for architecture arm64:
   "YGConfig::YGConfig(int (*)(YGConfig*, YGNode*, YGLogLevel, char const*, char*))", referenced from:
      _YGConfigNew in libyoga.a(Yoga.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

更多信息:

react: 16.9.0
react-native: 0.60.5
Real device: iPad with iOS 12.4.4

有人有解决办法吗?谢谢

最佳答案

我刚刚花了最后一个小时来解决这个完全相同的问题,并在他们的 repo 协议(protocol)中偶然发现了这条评论,最终为我修复了它。在我的例子中,结果证明是 Xcode 缓存的问题:

https://github.com/facebook/react-native/issues/25349#issuecomment-518830530

close xcode and any other IDE
rm -rf ~/library/developer/xcode/deriveddata
rm -rf ~/.rncache
rm -rf node_modules && npm install && cd ios && rm -rf Pods && pod install && cd ..

希望这对您也有帮助!

关于ios - 架构 arm64 的 undefined symbol : _YGConfigNew in libyoga. a(Yoga.o),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59825748/

相关文章:

ios - iPhone Motion - EXC 访问错误

ios - 更新 Xcode10 中的 J2ObjC 库

iphone - UIImageView 背景图片和旋转帮助

ios - UITabViewController : Selected Tab, 更新UIViewController

android - react native 选择器样式自定义字体

ios - React native 性能模拟器与真实设备

react-native - 如何 react 原生滚动文本?

ios - UIimageView 和 Accessory View 在 UITableViewCell 中分开工作

objective-c - Cocoa Audio/QTKit [播放/暂停切换按钮](错误)

swift - Swift 中带有格式说明符的 NSLocalizedString 会产生垃圾