Xcode build failure due to Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider

Viewed 7167

Building failed with Xcode 13beta for React Native 0.64.2 project. It is on macOS Big Sur. The detail of error is:

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)

What configuration change is needed to eliminate the error?

3 Answers

Create an empty swift file (####.swift) from Xcode in the main project which located Appdelegate.h file. This worked for my React Native project after Xcode version 13 update.

Try creating a new Swift empty file (it's not necessary to create a Bridging Header).

Related