SwiftMonkey icon indicating copy to clipboard operation
SwiftMonkey copied to clipboard

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"

Open dragonhn opened this issue 4 years ago • 33 comments

building err

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

image

dragonhn avatar Sep 25 '19 03:09 dragonhn

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

dragonhn avatar Sep 25 '19 07:09 dragonhn

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?

wojciechczerski avatar Oct 02 '19 22:10 wojciechczerski

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

IvanMaoCode avatar Nov 13 '19 07:11 IvanMaoCode

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.

acalism avatar Mar 27 '20 13:03 acalism

@acalism

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

sandeep-madineni avatar Jun 01 '20 10:06 sandeep-madineni

@acalism

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

Then remove the empty file as you wish.

acalism avatar Jun 22 '20 09:06 acalism

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?

HamGuy avatar Jul 03 '20 08:07 HamGuy

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!

dhavalpanchani avatar Aug 08 '20 05:08 dhavalpanchani

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 ?

Philrobots avatar Sep 21 '20 13:09 Philrobots

Check this https://blog.cpming.top/p/react-native-0-62-undefined-symbol

rcpassos avatar Sep 22 '20 14:09 rcpassos

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.

demirisak avatar Oct 12 '20 09:10 demirisak

Void.swift

in which folder we have to create the file ??

devprakashbinary avatar Nov 07 '20 03:11 devprakashbinary

Void.swift

in which folder we have to create the file ??

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

Rupali97 avatar Nov 11 '20 10:11 Rupali97

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?

Alfredowss avatar Nov 21 '20 23:11 Alfredowss

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?

ownself avatar Nov 26 '20 09:11 ownself

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.

armendu avatar Jan 20 '21 21:01 armendu

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!

gabrielmaldi avatar Feb 25 '21 12:02 gabrielmaldi

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.

ownself avatar Feb 26 '21 02:02 ownself

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.

sanjeevkse avatar Mar 27 '21 05:03 sanjeevkse

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.

VaheSaroyan avatar Jul 02 '21 08:07 VaheSaroyan

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

dhayaljaswantgit avatar Jul 14 '21 16:07 dhayaljaswantgit

what the hell is this sorcery

nikitph avatar Oct 01 '21 09:10 nikitph

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

dthomason avatar Oct 02 '21 05:10 dthomason

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)

vladles avatar Oct 12 '21 15:10 vladles

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

image image

Amazing!

hu-qi avatar Oct 21 '21 03:10 hu-qi

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?

Adnan-Bacic avatar Oct 22 '21 13:10 Adnan-Bacic

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 avatar Nov 04 '21 03:11 hstdt

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

alawneh0 avatar Nov 19 '21 10:11 alawneh0

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

ShobhitChourasia avatar Dec 21 '21 14:12 ShobhitChourasia

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?

mixraidxx avatar Dec 28 '21 05:12 mixraidxx