flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.63k stars 27.35k forks source link

Apple Silicon CocoaPods workaround issue #73686

Closed xster closed 3 years ago

xster commented 3 years ago

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_gallery

Error 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 :85:in `require' :85:in `require' /Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in ' /Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `' :85:in `require' :85:in `require' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `' :85:in `require' :85:in `require' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `' :85:in `require' :85:in `require' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:74:in `cdn_url?' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178:in `block in sources' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `map' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `sources' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/bin/pod:55:in `' /Users/xster/.rvm/gems/ruby-3.0.0/bin/pod:23:in `load' /Users/xster/.rvm/gems/ruby-3.0.0/bin/pod:23:in `
' ``` ――― TEMPLATE END ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― [!] Oh no, an error occurred. Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FUsers%2Fxster%2F.rvm%2Frubies%2Fruby-3.0.0%2Flib%2Fruby%2Fgems%2F3.0.0%2Fgems%2Fffi-1.14 .2%2Flib%2Fffi_c.bundle%2C+9%29%3A+no+suitable+image+found.++Did+find%3A%0A%09%2FUsers%2Fxster%2F.rvm%2Frubies%2Fruby-3.0.0%2Flib%2Fruby%2Fgems%2F3. 0.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle%3A+mach-o%2C+but+wrong+architecture%0A%09%2FUsers%2Fxster%2F.rvm%2Frubies%2Fruby-3.0.0%2Flib%2Fruby%2Fg ems%2F3.0.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle%3A+mach-o%2C+but+wrong+architecture+-+%2FUsers%2Fxster%2F.rvm%2Frubies%2Fruby-3.0.0%2Flib%2Frub y%2Fgems%2F3.0.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle&type=Issues If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md Don't forget to anonymize any private data! Looking for related issues on cocoapods/cocoapods... Error output from CocoaPods: ↳ Searching for inspections failed: undefined method `map' for nil:NilClass [!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`. Error running pod install Error launching application on iPhone 12 Pro Max. ```
Abhishek01039 commented 3 years ago

@xster can you please try sudo gem install ffi?

xster commented 3 years ago

I get this error:

Error ``` Running pod install... 902ms 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` Error output from CocoaPods: ↳ /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/curls/options.rb:103: [BUG] Segmentation fault at 0x0000000000000000 ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20] -- Crash Report log information -------------------------------------------- See Crash Report log file under the one of following: * ~/Library/Logs/DiagnosticReports * /Library/Logs/DiagnosticReports for more details. Don't forget to include the above Crash Report log file in bug reports. -- Control frame information ----------------------------------------------- c:0038 p:---- s:0230 e:000229 CFUNC :easy_setopt_string c:0037 p:1164 s:0223 e:000222 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/curls/options.rb:103 c:0036 p:0019 s:0210 e:000209 BLOCK /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/options.rb:35 [FINISH] c:0035 p:0053 s:0206 e:000205 BLOCK /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy.rb:240 [FINISH] c:0034 p:---- s:0200 e:000199 CFUNC :each_pair c:0033 p:0005 s:0196 e:000195 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy.rb:235 c:0032 p:0012 s:0191 e:000190 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/http/actionable.rb:99 c:0031 p:0006 s:0186 e:000185 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/http/get.rb:17 c:0030 p:0016 s:0181 e:000180 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/http.rb:39 c:0029 p:0031 s:0174 e:000173 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/easy_factory.rb:81 c:0028 p:0014 s:0168 e:000167 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/operations.rb:15 c:0027 p:0025 s:0163 e:000162 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/cacheable.rb:18 c:0026 p:0033 s:0158 e:000157 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/block_connection.rb:31 c:0025 p:0041 s:0154 e:000153 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb:25 c:0024 p:0020 s:0149 e:000148 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/before.rb:26 c:0023 p:0025 s:0145 e:000144 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/actions.rb:22 c:0022 p:0044 s:0139 e:000138 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:76 c:0021 p:0012 s:0131 e:000130 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:36 c:0020 p:0014 s:0120 e:000119 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21 c:0019 p:0008 s:0115 e:000114 BLOCK /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178 [FINISH] c:0018 p:---- s:0111 e:000110 CFUNC :map c:0017 p:0119 s:0107 e:000106 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177 c:0016 p:0025 s:0098 e:000093 BLOCK /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073 c:0015 p:0068 s:0090 e:000089 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64 c:0014 p:0073 s:0083 e:000082 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072 c:0013 p:0142 s:0076 e:000075 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124 c:0012 p:0009 s:0061 e:000060 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414 c:0011 p:0006 s:0056 e:000055 BLOCK /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239 c:0010 p:0068 s:0053 e:000052 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64 c:0009 p:0047 s:0046 e:000045 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238 c:0008 p:0007 s:0040 e:000039 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160 c:0007 p:0046 s:0036 e:000035 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52 c:0006 p:0072 s:0031 e:000030 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/claide-1.0.3/lib/claide/command.rb:334 c:0005 p:0020 s:0024 e:000023 METHOD /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52 c:0004 p:0399 s:0019 e:000018 TOP /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/bin/pod:55 [FINISH] c:0003 p:---- s:0013 e:000012 CFUNC :load c:0002 p:0112 s:0008 E:001d00 EVAL /Users/xster/.rvm/gems/ruby-3.0.0/bin/pod:23 [FINISH] c:0001 p:0000 s:0003 E:001f40 (none) [FINISH] -- Ruby level backtrace information ---------------------------------------- /Users/xster/.rvm/gems/ruby-3.0.0/bin/pod:23:in `
' /Users/xster/.rvm/gems/ruby-3.0.0/bin/pod:23:in `load' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/bin/pod:55:in `' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `sources' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `map' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178:in `block in sources' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url' /Users/xster/.rvm/gems/ruby-3.0.0/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:76:in `cdn_url?' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/actions.rb:22:in `get' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/before.rb:26:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb:25:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/block_connection.rb:31:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/cacheable.rb:18:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/request/operations.rb:15:in `run' /Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/easy_factory.rb:81:in `get' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/http.rb:39:in `http_request' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/http/get.rb:17:in `setup' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/http/actionable.rb:99:in `setup' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy.rb:235:in `set_attributes' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy.rb:235:in `each_pair' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy.rb:240:in `block in set_attributes' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/easy/options.rb:35:in `block (2 levels) in ' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/curls/options.rb:103:in `set_option' /Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon/curls/options.rb:103:in `easy_setopt_string' ```
jmagman commented 3 years ago

Maybe you had an arm64 ffi hanging around?

sudo gem uninstall ffi
arch -x86_64 sudo gem install ffi
xster commented 3 years ago

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

jmagman commented 3 years ago

Do you have Rosetta installed? When you launch Xcode it prompts you, I think.

xster commented 3 years ago

I did

markusaksli-nc commented 3 years ago

Works just fine for me.

flutter doctor -v ``` [✓] Flutter (Channel master, 1.26.0-2.0.pre.296, on macOS 11.1 20C69 darwin-arm, locale en-GB) • Flutter version 1.26.0-2.0.pre.296 at /Users/nevercode/development/flutter_master • Framework revision 737496e8db (6 hours ago), 2021-01-12 02:54:03 -0500 • Engine revision 10cee6abcb • Dart version 2.12.0 (build 2.12.0-214.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/nevercode/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • Java binary at: /Users/nevercode/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 12.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.3, Build version 12C33 • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Users/nevercode/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents • Flutter plugin can be installed from: � https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: � https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] Connected device (4 available) • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios • iOS 14.3 • iPhone 12 Pro Max (mobile) • 09D9E93F-A98D-4735-B6E6-6E57F9CD01D8 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 11.1 20C69 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.141 • No issues found! ```
Logs ```console nevercode@Nevercodes-Mac-mini ~ % arch arm64 nevercode@Nevercodes-Mac-mini ~ % arch -x86_64 sudo gem install ffi Password: Fetching ffi-1.14.2.gem Building native extensions. This could take a while... Successfully installed ffi-1.14.2 Parsing documentation for ffi-1.14.2 Installing ri documentation for ffi-1.14.2 Done installing documentation for ffi after 8 seconds 1 gem installed nevercode@Nevercodes-Mac-mini ~ % sudo gem install cocoapods Successfully installed cocoapods-1.10.1 Parsing documentation for cocoapods-1.10.1 Done installing documentation for cocoapods after 0 seconds 1 gem installed nevercode@Nevercodes-Mac-mini ~ % arch -x86_64 open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/ nevercode@Nevercodes-Mac-mini ~ % cd Development nevercode@Nevercodes-Mac-mini Development % cd flutter_master nevercode@Nevercodes-Mac-mini flutter_master % cd dev/integration_tests/flutter_gallery nevercode@Nevercodes-Mac-mini flutter_gallery % flm run -d iPhone Running "flutter pub get" in flutter_gallery... 18.3s Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Warning: Missing build name (CFBundleShortVersionString). Warning: Missing build number (CFBundleVersion). Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store. Running pod install... 2,680ms Running Xcode build... └─Compiling, linking and signing... 5.0s Xcode build done. 19.6s Syncing files to device iPhone 12 Pro Max... 176ms Flutter run key commands. r Hot reload. ��� R Hot restart. h Repeat this help message. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device). An Observatory debugger and profiler on iPhone 12 Pro Max is available at: http://127.0.0.1:53765/JiMJVPgxWF0=/ � Running with sound null safety � Application finished. nevercode@Nevercodes-Mac-mini flutter_gallery % flm run -d macos Launching lib/main.dart on macOS in debug mode... Running pod install... 1,074ms 2021-01-12 16:02:55.724 xcodebuild[15214:6953256] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371 Details: (null) deviceType from b668e524315069f3db3661ac11ff1f66afafebdb was NULL when -platform called. Object: Method: -platform Thread: {number = 4, name = (null)} Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. 2021-01-12 16:02:55.900 xcodebuild[15214:6953260] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371 Details: (null) deviceType from b668e524315069f3db3661ac11ff1f66afafebdb was NULL when -platform called. Object: Method: -platform Thread: {number = 10, name = (null)} Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. 2021-01-12 16:02:55.957 xcodebuild[15214:6953260] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371 Details: (null) deviceType from b668e524315069f3db3661ac11ff1f66afafebdb was NULL when -platform called. Object: Method: -platform Thread: {number = 10, name = (null)} Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. Building macOS application... Syncing files to device macOS... 113ms Flutter run key commands. r Hot reload. ��� R Hot restart. h Repeat this help message. d Detach (terminate "flutter run" but leave application running). c Clear the screen q Quit (terminate the application on the device). An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:53942/frlvjQ3ITr8=/ � Running with sound null safety � Application finished. ```
xster commented 3 years ago

aha! I've isolated the issue. The workaround works for macOS 11's system ruby but doesn't work when using rvm.

xster commented 3 years ago

Or could this be a ruby version issue rather. Rvm with ruby 2.7.2 works. Rvm with ruby 3.0 didn't.

xster commented 3 years ago

Looks like latest Homebrew is on Ruby 3 also. Let me see if I can repro without RVM.

xster commented 3 years ago

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... 🤷‍♂️

jmagman commented 3 years ago

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.

github-actions[bot] commented 3 years ago

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.