upgrade-support icon indicating copy to clipboard operation
upgrade-support copied to clipboard

IOS: Undefined symbols for architecture x86_64: "_swift_getFunctionReplacement", referenced from:

Open jlariza opened this issue 4 years ago • 10 comments

Environment

System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.58 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.17.0 - ~/.nvm/versions/node/v10.17.0/bin/node
    Yarn: 1.21.1 - ~/.nvm/versions/node/v10.17.0/bin/yarn
    npm: 6.11.3 - ~/.nvm/versions/node/v10.17.0/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6241897
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: javac 14 - /usr/bin/javac
    Python: 3.7.7 - /Users/jariza/.pyenv/shims/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0
    react-native: 0.62.2 => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found

Upgrading version

0.62.2

Description

Good day, I am trying to upgrade a project to RN 0.62.2 from 0.61. On android it is working fine, however on iOS I am getting this error when running react-native run-ios

Undefined symbols for architecture x86_64:
  "_swift_getFunctionReplacement", referenced from:
      _swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o)
     (maybe you meant: _swift_getFunctionReplacement50)
  "_swift_getOrigOfReplaceable", referenced from:
      _swift_getOrigOfReplaceable50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o)
     (maybe you meant: _swift_getOrigOfReplaceable50)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I followed all instructions detailed here #13 and When I build the app from xcode interface, it runs with no errors. However, when trying to run it with react-native run-ios it raises the error. Do you have any idea why is it happening?

Thank you

jlariza avatar May 16 '20 03:05 jlariza

I tried this solution https://github.com/react-native-community/upgrade-support/issues/25#issue-591311756 But it did not work. any idea?

jlariza avatar May 16 '20 16:05 jlariza

I removed all flipper references from ios/Podfile and from ios/<project-name>/AppDelegate.m to make it work, but I will not be able to use Flipper in my project...

jlariza avatar May 16 '20 17:05 jlariza

I have exactly the same issue. Finally resolved with this: https://github.com/react-native-community/upgrade-support/issues/25#issuecomment-658066246

JeremyBradshaw7 avatar Jul 17 '20 15:07 JeremyBradshaw7

Got past this issue with https://blog.cpming.top/p/undefined-symbol-swift-getfunctionreplacement @0.63.2

In Xcode, select PROJECT-> Build Settings-> LInking-> Dead Code stripping -> YES

tacitomv avatar Aug 03 '20 19:08 tacitomv

I solved following #25 (comment) per @JeremyBradshaw7's comments. I've placed Yes for Dead Code Stripping, however it doesn't work in the first time, because I forgot to set this option for All the Targets as well and NOT ONLY the project.

Brenw10 avatar Oct 02 '20 00:10 Brenw10

I have the same error, but Build Settings-> LInking-> Dead Code stripping -> YES is already to YES, in project and all targets, any idea how to fix?

Piero87 avatar Oct 03 '20 22:10 Piero87

I am getting:

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After upgrade to 0.63.3

ghasemikasra39 avatar Oct 14 '20 10:10 ghasemikasra39

I am getting:

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After upgrade to 0.63.3

I am also facing same issue,

Undefined symbol: ___darwin_check_fd_set_overflow

pankajgupta1 avatar Oct 19 '20 07:10 pankajgupta1

I am getting:

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After upgrade to 0.63.3

I am also facing same issue,

Undefined symbol: ___darwin_check_fd_set_overflow

upgrading xcode worked for me :)

pankajgupta1 avatar Oct 19 '20 16:10 pankajgupta1

I am also getting the same issue, yet I have enabled dead code stripping. This is while previewing the watch os app,

linker command failed with exit code 1 (use -v to see invocation) ---------------------------------------- SchemeBuildError: Failed to build the scheme "watchApp" `linker command failed with exit code 1 (use -v to see invocation)` Link AppName(x86_64): Undefined symbols for architecture x86_64: "_swift_getFunctionReplacement", referenced from: _swift_getFunctionReplacement50 in libswiftCompatibilityDynamicReplacements.a(DynamicReplaceable.cpp.o) (maybe you meant: _swift_getFunctionReplacement50) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

shehanGuruge avatar Aug 30 '21 00:08 shehanGuruge