Skip to content

Apple Silicon CocoaPods workaround issue #73686

@xster

Description

@xster

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-host-armBuilding on an ARM-based platformplatform-iosiOS applications specificallyplatform-macBuilding on or for macOS specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions