由于未定义的符号,Xcode 构建失败:__swift_FORCE_LOAD_$_swiftFileProvider

use*_*363 11 macos xcode react-native

使用 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)
Run Code Online (Sandbox Code Playgroud)

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

小智 19

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