zalando / SwiftMonkey

A framework for doing randomised UI testing of iOS apps
MIT License
1.95k stars 174 forks source link

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 5 years ago

dragonhn commented 5 years ago

building err

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

image

dragonhn commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

acalism commented 4 years ago

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 commented 4 years ago

@acalism

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

acalism commented 4 years ago

@acalism

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

Then remove the empty file as you wish.

HamGuy commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

demirisak commented 4 years ago

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 commented 4 years ago

Void.swift

in which folder we have to create the file ??

Rupali97 commented 4 years ago

Void.swift

in which folder we have to create the file ??

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

Alfredowss commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

what the hell is this sorcery

dthomason commented 3 years ago

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

vladles commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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

ShobhitChourasia commented 2 years ago

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

mixraidxx commented 2 years ago

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 commented 2 years ago

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

Yep, just running this solved my issue:

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

OsamaSaleem95 commented 2 years ago

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 commented 2 years ago

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.