Closed xster closed 3 years ago
@xster
can you please try sudo gem install ffi
?
I get this error:
Maybe you had an arm64 ffi hanging around?
sudo gem uninstall ffi
arch -x86_64 sudo gem install ffi
With arch -x86_64 sudo gem install ffi, I get the first error https://github.com/flutter/flutter/issues/73686#issue-783090646
With just gem install ffi or sudo gem install ffi, I get the second error https://github.com/flutter/flutter/issues/73686#issuecomment-758088507
Do you have Rosetta installed? When you launch Xcode it prompts you, I think.
I did
Works just fine for me.
aha! I've isolated the issue. The workaround works for macOS 11's system ruby but doesn't work when using rvm.
Or could this be a ruby version issue rather. Rvm with ruby 2.7.2 works. Rvm with ruby 3.0 didn't.
Looks like latest Homebrew is on Ruby 3 also. Let me see if I can repro without RVM.
Ummm Ruby 3 from homebrew works (after changing path since homebrew doesn't do it automatically to override system ruby).
Strangely after rvm get stable
then arch -x86_64 sudo gem install ffi
, arch -x86_64 sudo gem install cocoapods
again, I can't repro on rvm ruby 3 anymore either... 🤷♂️
Even when I worked on Ruby projects I avoided rvm
, it caused so many more issues for me than it solved. But that was like 8 years ago so maybe my knowledge is out of date. I've definitely never needed it while developing Flutter.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
On Apple Silicon device,
arch -x86_64 sudo gem install ffi
,gem install cocoapods
,arch -x86_64 open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/
, then run dev/integration_tests/flutter_galleryError message
``` CocoaPods' output: ↳ Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``) Fetching external sources -> Fetching podspec for `Flutter` from `Flutter` -> Fetching podspec for `connectivity` from `.symlinks/plugins/connectivity/ios` -> Fetching podspec for `device_info` from `.symlinks/plugins/device_info/ios` -> Fetching podspec for `integration_test` from `.symlinks/plugins/integration_test/ios` -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios` -> Fetching podspec for `video_player` from `.symlinks/plugins/video_player/ios` Resolving dependencies of `Podfile` ――― MARKDOWN TEMPLATE ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ### Command ``` /Users/xster/.rvm/gems/ruby-3.0.0/bin/pod install --verbose ``` ### Report * What did you do? * What did you expect to happen? * What happened instead? ### Stack ``` CocoaPods : 1.10.1 Ruby : ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20] RubyGems : 3.2.3 Host : macOS 11.1 (20C69) Xcode : 12.3 (12C33) Git : git version 2.30.0 Ruby lib dir : /Users/xster/.rvm/rubies/ruby-3.0.0/lib Repositories : ``` ### Plugins ``` cocoapods-deintegrate : 1.0.4 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.0 cocoapods-trunk : 1.5.0 cocoapods-try : 1.2.0 ``` ### Podfile ```ruby # Uncomment this line to define a global platform for your project # platform :ios, '9.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = '' end end end ``` ### Error ``` LoadError - dlopen(/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 9): no suitable image found. Did find: /Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.14.2/lib/ffi_c.bundle: mach-o, but wrong architecture /Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.14.2/lib/ffi_c.bundle: mach-o, but wrong architecture - /Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.14.2/lib/ffi_c.bundle