Undefined symbol _swift_getFunctionReplacement

The issue was caused by this line: 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift-$(SWIFT_VERSION)/$(PLATFORM_NAME) $(inherited)' in a podspec of testing framework.

The line was added, because it was the only way to link with XCTest properly on Xcode 11. It is the only way I found on the internet so far and I was working on this problem for a long time.

It would be nice to know a better way to make a cocoapods pod that links with XCTest.

Example of pull request with fix: Switch swift_version to 5.0 and add LIBRARY_SEARCH_PATHS in xcconfig by artyom-razinov · Pull Request #315 · Brightify/Cuckoo · GitHub (this fixed linking in runtime if tests are built with Xcode 11).

Similar issue (making pod for testing): RxTest referencing to invalid libswiftXCTest.dylib · Issue #2072 · ReactiveX/RxSwift · GitHub

1 Like