skip to Main Content

When attempting "flutter run" from step 3.5 of the official "Add Firebase to your app" tutorial with the standard flutter starter app (So as to limit other potential issues) (See https://firebase.google.com/docs/flutter/setup?authuser=0&hl=en&platform=ios), I get the following output in the debug console:

{ from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in section' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in resolve_dependencies’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in install!' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in run’
from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in run’
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in <top (required)>' from /usr/local/bin/pod:23:in load’
from /usr/local/bin/pod:23:in `’
Error: To set up CocoaPods for ARM macOS, run:
arch -x86_64 sudo gem install ffi

Error running pod install
Error launching application on iPhone 12.
Exited}

And then when I run the suggested:

{arch -x86_64 sudo gem install ffi}

It appears to run successfully, printing:

{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}

But if I then re-run "flutter run", I get exactly the same error as before.

I’ve tried flutter clean, uninstalling and reinstalling the -x86_64 versions of both ffi and cocoapods but still keep getting the same error…

Any ideas?

2

Answers


  1. Chosen as BEST ANSWER

    Managed to solve this by running arch -x86_64 pod install from the /ios folder.


  2. Try this:

    • Delete Podfile.lock file in the iOS folder of your flutter project.
    • Run in terminal from the root of your project in iOS folder:
      arch -x86_64 sudo gem install ffi and then arch -x86_64 pod install.
    • Clean your project in XCode using Shift+command+K.
    • Now try to build the project again.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search