dyld:找不到符号:_ffi_prep_closure_loc(在 Mac 上)

Tou*_*der 3 dyld cocoapods flutter

flutter run在我的 Mac 上做了一个常规,今天针对我的 iPhone 模拟器并得到了这些错误。

Error output from CocoaPods:
?
    dyld: lazy symbol binding failed: Symbol not found: _ffi_prep_closure_loc
      Referenced from: /Users/toure/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
      Expected in: /usr/lib/libffi.dylib

    dyld: Symbol not found: _ffi_prep_closure_loc
      Referenced from: /Users/toure/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
      Expected in: /usr/lib/libffi.dylib
Run Code Online (Sandbox Code Playgroud)

你如何解决dyld: Symbol not found: _ffi_prep_closure_loc错误?

Tou*_*der 8

我发现了一个隐藏在github 问题中的修复程序。

在我的 Mac 上运行它解决了这个问题。

gem uninstall ffi
brew reinstall libffi
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
gem install ffi
Run Code Online (Sandbox Code Playgroud)

我决定分享这个,因为问题标题中的错误与我得到的不同。希望这可以节省一些时间。


Apo*_*oad 6

我可以通过使用以下标志重新安装该实用程序来解决此问题:

\n

gem install ffi -- --disable-system-libffi

\n

事实证明ffi-1.13.1正在使用ffi_prep_closure_loc()system-libffi\xe2\x80\x99t 没有该功能。

\n

请参阅ffi问题# 791有关更多

\n