【问题标题】:Xcode build failure due to Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider由于未定义的符号,Xcode 构建失败:__swift_FORCE_LOAD__$_swiftFileProvider
【发布时间】:2021-10-20 15:10:09
【问题描述】:

使用 Xcode 13beta 为 React Native 0.64.2 项目构建失败。它在 macOS Big Sur 上。错误的详细信息是:

Undefined symbols for architecture x86_64:
  "__swift_FORCE_LOAD_$_swiftFileProvider", referenced from:
      __swift_FORCE_LOAD_$_swiftFileProvider_$_YogaKit in libYogaKit.a(YGLayoutExtensions.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftFileProvider_$_YogaKit)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

需要进行哪些配置更改才能消除错误?

【问题讨论】:

标签: xcode macos react-native


【解决方案1】:

在位于 Appdelegate.h 文件的主项目中从 Xcode 创建一个空的 swift 文件 (####.swift)。在 Xcode 版本 13 更新后,这适用于我的 React Native 项目。

【讨论】:

  • 我遵循了这个并且它起作用了。但是你能告诉我为什么这行得通吗?
  • 谢谢。不知道为什么会这样。
  • 我在主项目中添加了一个 void.swift,但仍然出现同样的错误
  • Xcode 13.2.1, RN 0.64.1:确实解决了这个问题
【解决方案2】:

尝试创建一个新的 Swift 空文件(不必创建桥接头)。

【讨论】:

    【解决方案3】:

    在 XCode 中将 libswiftWebKit.tbd 添加到 Link Binary With Libraries 构建阶段有助于解决问题:

    enter image description here

    【讨论】:

      猜你喜欢
      • 2019-11-13
      • 2021-10-23
      • 1970-01-01
      • 2021-06-27
      • 2021-02-18
      • 2017-02-09
      • 2015-09-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多