Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

xcode 11.0 use pod build err " Showing All Messages Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements" and " Showing All Messages Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility50" #80

Open
dragonhn opened this issue Sep 25, 2019 · 33 comments

Comments

@dragonhn
Copy link

building err

Showing All Messages Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements
Showing All Messages
Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility50

image

@dragonhn
Copy link
Author

dragonhn commented Sep 25, 2019

project->build settings->search path->Library Search Paths add Code

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

build success

@wojciechczerski
Copy link
Member

Could you provide more details about your setup? Xcode version, CocoaPods version, how are you integrating SwiftMonkey and SwiftMonkeyPaws. Ideally, could you provide a sample project? Also Does the sample provided with the framework work for you?

@IvanMaoCode
Copy link

I have the same error with Xcode 11.2.1, cocoapods (1.8.4)

@acalism
Copy link

acalism commented Mar 27, 2020

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

If you want to know what Xcode has done, submit the code before creating the file, and check the changes after creating the file.

@sandeep-madineni
Copy link

@acalism

Is there any way to fix it with out creating empty Swift file?

@acalism
Copy link

acalism commented Jun 22, 2020

@acalism

Is there any way to fix it with out creating empty Swift file?

Then remove the empty file as you wish.

@HamGuy
Copy link

HamGuy commented Jul 3, 2020

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

Thanks for the answer, but I'd like to know how dose it work?

@dhavalpanchani
Copy link

project->build settings->search path->Library Search Paths add Code

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

build success

you saved my day, Thank you man!

@Philrobots
Copy link

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

Thanks for the answer, but I'd like to know how dose it work?

It works for me too ! Thanks buddy but yeah, why ?

@rcpassos
Copy link

@demirisak
Copy link

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

It is great solution.

@devprakashbinary
Copy link

Void.swift

in which folder we have to create the file ??

@Rupali97
Copy link

Void.swift

in which folder we have to create the file ??

i also have same doubt.. did u find answer?

@Alfredowss
Copy link

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

This function perfectly, but why works?

@ownself
Copy link

ownself commented Nov 26, 2020

project->build settings->search path->Library Search Paths add Code

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

build success

This is the correct solution eventually in my case, but there is one more detail I found out which I think worth to mention.
If you made a framework which uses swift library (swiftCompatibility*.a) and then other project uses this framework will encounter similar link error even if they put those paths into "Library Search Paths". One of the failure is by compiling the framework and project with different Xcode version (for saying, Xcode 11 to compile framework and Xcode 12 to compile project which uses previous framework).
I don't know why but somehow it can not automatically search the .a file, maybe because they are different version?

@armendu
Copy link

armendu commented Jan 20, 2021

Void.swift

in which folder we have to create the file ??

i also have same doubt.. did u find answer?

You need to create in the main project folder, in the same folder as the AppDelegate file.
It solved the issue for me, so hopefully it does for you as well.

@gabrielmaldi
Copy link

One of the failure is by compiling the framework and project with different Xcode version (for saying, Xcode 11 to compile framework and Xcode 12 to compile project which uses previous framework).
I don't know why but somehow it can not automatically search the .a file, maybe because they are different version?

@ownself, did you ever find a solution to this problem? Thanks!

@ownself
Copy link

ownself commented Feb 26, 2021

One of the failure is by compiling the framework and project with different Xcode version (for saying, Xcode 11 to compile framework and Xcode 12 to compile project which uses previous framework).
I don't know why but somehow it can not automatically search the .a file, maybe because they are different version?

@ownself, did you ever find a solution to this problem? Thanks!

So far for us, we found one way to deal it, which you need to manually copy the *.a file into your framework project and explicitly link with it. That will make sure no matter which version of XCode they use for their project, when they link with your framework it will always link with your local copied *.a library file.

@sanjeevkse
Copy link

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

You are the real saver. Thanks a lot.

@VaheSaroyan
Copy link

Figured this out. 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.

@dhayaljaswantgit
Copy link

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

This way I was able to fix this issue, refer the below images =>

Screenshot 2021-07-14 at 9 28 39 PM

Screenshot 2021-07-14 at 9 30 06 PM

Screenshot 2021-07-14 at 9 30 42 PM

Screenshot 2021-07-14 at 9 26 07 PM

@nikitph
Copy link

nikitph commented Oct 1, 2021

what the hell is this sorcery

@dthomason
Copy link

😂😂 hours wasted only to find out this is the fix. Wow 🤷🏻

@vladles
Copy link

vladles commented Oct 12, 2021

project->build settings->search path->Library Search Paths add Code

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

build success

From Xcode13 you should add new param:
"$(SDKROOT)/usr/lib/swift"

2021-10-12_18-47-28 (2)

@hu-qi
Copy link

hu-qi commented Oct 21, 2021

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

image
image

Amazing!

@Adnan-Bacic
Copy link

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

out of curiosity, do we know if it will ever be safe to remove the Void.swift file again? or do we just accept that it will stay there for the project to work?

@hstdt
Copy link

hstdt commented Nov 4, 2021

project->build settings->search path->Library Search Paths add Code

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

build success

From Xcode13 you should add new param: "$(SDKROOT)/usr/lib/swift"

2021-10-12_18-47-28 (2)

Xcode 13.1:

In my case, dyld`__abort_with_payload: appeared.

CleanShot 2021-11-04 at 11 39 46

@alawneh0
Copy link

creating an empty swift file solved the issue for me. any explanations? 😳😳😂

@ShobhitChourasia
Copy link

ShobhitChourasia commented Dec 21, 2021

Alternate for those who already have bridging header:
update cocapods to latest version and do pod install.

@mixraidxx
Copy link

project->build settings->search path->Library Search Paths add Code

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)"
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

build success

From Xcode13 you should add new param: "$(SDKROOT)/usr/lib/swift"
2021-10-12_18-47-28 (2)

Xcode 13.1:

In my case, dyld`__abort_with_payload: appeared.

CleanShot 2021-11-04 at 11 39 46

@hstdt I have the same problem, did you solve it?

@sandolkakos
Copy link

sandolkakos commented Jan 27, 2022

Alternate for those who already have bridging header: update cocapods to latest version and do pod install.

Yep, just running this solved my issue:

  • sudo gem uninstall cocoapods (uninstalls the current version)
  • sudo gem install cocoapods (installs the latest version)
  • pod repo update (updates the local repository with latest from the remote)

If you still have the Xcode project built, you will need to reinstall the dependencies in the current project:

  • pod install

@OsamaSaleem95
Copy link

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

What?? I mean how does it work??

@acalism
Copy link

acalism commented Jul 4, 2022

Create an Empty Swift file using Xcode, such as named Void.swift, and every issue will be solved by Xcode automatically.

What?? I mean how does it work??

If you want to know what Xcode has done, submit the code before creating the file, and check the changes after creating the file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests