Repository navigation
Apple Silicon CocoaPods workaround issue #73686
Copy link
Copy link
Closed
Labels
platform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-iosiOS applications specificallyiOS applications specificallyplatform-macosBuilding on or for macOS specificallyBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
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
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>: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 <top (required)>'
/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/Users/xster/.rvm/gems/ruby-3.0.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/Users/xster/.rvm/gems/ruby-3.0.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/Users/xster/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>: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 `<top (required)>'
/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 `<main>'
```
――― 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
platform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-iosiOS applications specificallyiOS applications specificallyplatform-macosBuilding on or for macOS specificallyBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
Abhishek01039 commentedon Jan 11, 2021
@xster
can you please try
sudo gem install ffi?xster commentedon Jan 11, 2021
I get this error:
Error
jmagman commentedon Jan 11, 2021
Maybe you had an arm64 ffi hanging around?
xster commentedon Jan 12, 2021
With arch -x86_64 sudo gem install ffi, I get the first error #73686 (comment)
With just gem install ffi or sudo gem install ffi, I get the second error #73686 (comment)
jmagman commentedon Jan 12, 2021
Do you have Rosetta installed? When you launch Xcode it prompts you, I think.
xster commentedon Jan 12, 2021
I did
markusaksli-nc commentedon Jan 12, 2021
Works just fine for me.
flutter doctor -v
Logs
xster commentedon Jan 22, 2021
aha! I've isolated the issue. The workaround works for macOS 11's system ruby but doesn't work when using rvm.
xster commentedon Jan 22, 2021
Or could this be a ruby version issue rather. Rvm with ruby 2.7.2 works. Rvm with ruby 3.0 didn't.
xster commentedon Jan 25, 2021
Looks like latest Homebrew is on Ruby 3 also. Let me see if I can repro without RVM.
xster commentedon Jan 25, 2021
Ummm Ruby 3 from homebrew works (after changing path since homebrew doesn't do it automatically to override system ruby).
Strangely after
rvm get stablethenarch -x86_64 sudo gem install ffi,arch -x86_64 sudo gem install cocoapodsagain, I can't repro on rvm ruby 3 anymore either... 🤷♂️jmagman commentedon Jan 25, 2021
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 commentedon Aug 6, 2021
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 -vand a minimal reproduction of the issue.