【发布时间】:2022-06-13 18:44:55
【问题描述】:
更新的上下文:
当我尝试运行颤振项目时,我得到了这个错误
Error: To set up CocoaPods for ARM macOS, run: arch -x86_64 sudo gem install ffi
我会运行arch -x86_64 sudo gem install ffi,但仍然遇到同样的问题。
这是信息
yomate@Mac-mini yomate % sudo gem install ffi
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /Users/yomate/FlutterDev/flutter/bin in PATH, mode 040777
Building native extensions. This could take a while...
Successfully installed ffi-1.15.5
Parsing documentation for ffi-1.15.5
Done installing documentation for ffi after 3 seconds
1 gem installed
如何解决这个问题?拱:posix_spawnp:gem:可执行文件中的CPU类型错误,环境:Mini M1
当我想使用这个推荐时
sudo arch -x86_64 gem install ffi 和 sudo arch -x86_64 gem install cocoapods
我遇到了这个错误。 arch: posix_spawnp: gem: Bad CPU type in executable
我的颤振仍然有错误。
[!] Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-arm, locale
en-AU)
✗ Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
【问题讨论】:
-
我不确定这是否是解决方法,但尝试卸载 ffi gem 并再次安装,这次是原生:
sudo gem install --user-install ffi,然后只需flutter run -
有同样的错误,@eeqk 的建议没有解决它。还有其他想法吗?
-
@ConleeC 确保您的二进制文件和 env 架构是对齐的,执行
arch、flutter doctor和dart --version- 它们都应该返回darwin-arm或arm64
标签: flutter flutter-ios