Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode build failure due to Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider

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?

like image 246
user938363 Avatar asked Aug 18 '21 20:08

user938363


People also ask

How do I fix undefined symbol in XCode?

The error Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SKAdImpression" during the iOS build usually happens if XCode or CocoaPods version is lower than required. To fix it update XCode to 12.5 or higher and CocoaPods to 1.10. 0 or higher.

What does undefined symbol mean in XCode?

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_xxx", referenced from: objc-class-ref in yyy.o. This generally means, you are calling "xxx" (it may be a framework or class) from the class "yyy". The compiler can not locate the "xxx" so this error occurs.

How do you fix undefined symbols in C++?

You need to pass the values to the function Calculate. Variables x, y, z and function are not accessible outside the class and also u need a return type to the function so that you can get the output from the function Calculate.

What is undefined symbols for architecture x86_64?

Why Is the Undefined Symbols for Architecture x86_64: Error Happening? This error is happening due to the lack of included values inside the declared statements in your code. The browser is going to render the information incorrectly and show this error, especially if you are working with Main and Similarity tools.

How do I run a swift program in Xcode?

Go to Xcode, in the project name, right click and click on “New file…” Select Swift File and click on Next Select the project target and Finish In the next screen select “Create bridging Header” - Make sure to bridge. Keep the swift file there for future in order to run the simulator. Thank you for making an account just to answer my question!

How to add Swift WebKit library in Xcode 12?

There is a new library in Xcode 12 that needs to be added to the Link Binary with Libraries phase call libSwiftWebKit.tbd. Error went away after adding this. Unfortunately, adding this library breaks compilation with Xcode 11, so you'll have to add & remove it depending on which version of Xcode you're using.

Is this a mixed Obj-C/Swift project?

This is a mixed Obj-C / Swift project, and these are not the only Swift classes in the project. I have not been able to determine what's special about these particular files compared to the others in the project.


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.

like image 56
Vimukthi Shohan Jayawardana Avatar answered Oct 22 '22 15:10

Vimukthi Shohan Jayawardana


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

like image 4
Cecilia Pirotto Avatar answered Oct 22 '22 15:10

Cecilia Pirotto


Adding libswiftWebKit.tbd into Link Binary With Libraries build phase in XCode helped to solve the problem:

enter image description here

like image 1
M. Koch Avatar answered Oct 22 '22 16:10

M. Koch