版权所有,转载请注明出处
最近有同学反应不能为flutter正确配置iOS开发环境,当执行brew install --HEAD libimobiledevice
时会遇到一个问题:
brew install --HEAD libimobiledevice
==> Cloning [https://git.libimobiledevice.org/libimobiledevice.git](https://git.libimobiledevice.org/libimobiledevice.git) Updating /Users/rjoiner/Library/Caches/Homebrew/libimobiledevice--git
==> Checking out branch master Already on 'master' Your branch is up to date with 'origin/master'. HEAD is now at b34e343 tools: Remove length check on device UDID arguments to support newer devices
==> ./autogen.sh Last 15 lines from /Users/rjoiner/Library/Logs/Homebrew/libimobiledevice/01.autogen.sh: checking dynamic linker characteristics... darwin16.7.0 dyld checking how to hardcode library paths into programs... immediate checking for pkg-config... /usr/local/opt/pkg-config/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes checking for libusbmuxd >= 1.1.0... no configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
Requested 'libusbmuxd >= 1.1.0' but version of libusbmuxd is 1.0.10
简直是黑人问号啊,输出这么一大堆信息。但我们仔细看最后一行,我们会发现异常所在Requested 'libusbmuxd >= 1.1.0' but version of libusbmuxd is 1.0.10
,很显然是由于系统要求的*libusbmuxd *版本和所要安装的版本不一致。
经过一番搜索终于找到了问题所在:
A recent change to
libimobiledevice
bumped the constraint on libusbmuxd to >= version 1.1.0. The currentusbmuxd
homebrew package is version 1.0.10.
As a result, homebrew--HEAD
installs of libimobiledevice no longer build without a--HEAD
install ofusbmuxd
.
Until theusbmuxd
homebrew formula is updated, a workaround is to install it at HEAD:
总之就是libimobiledevice更新了,我们可以通过下面的方式安装libimobiledevice:
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
希望本文对你有所帮助。欢迎加入 OpenFlutter交流群:892398530。