0

I can’t compile my Flutter App (iOS variant) when I added the package google_sign_in. At first, the symptom had to do with f f i pods (whatever they are). As per the resulting error message, I uninstalled ffi and re-installed it with the --enable-libffi-alloc switch as follows:



sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc

Now, I’m getting the following error:

Error output from CocoaPods:

/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon/curls/infos.rb:127: [BUG] Segmentation fault at 0xffffffffffffffa8

ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

Ive been looking for solutions to the above and the consensus seems to point to some pods incompatibility with my M1 processor. Ive been trying lots of suggestions for the past day, all to no avail, and I’m at wits end. Im hoping that somebody out there can help.



My environment is as follows:



Box: MacBook Air M1
    
OS: Monterey 12.2
    
Flutter Vers: 3.3.8
    
google_sign_in package vers: 5.4.2
    
    

Thanks in advance for any suggestions.



/Jose


Jose
  • 311
  • 2
  • 9

1 Answers1

0

I experienced the same issue, just with the firebase_core package.

The solution is the same as for https://stackoverflow.com/a/65334677/515239

Install cocoapods via Homebrew instead of using the system installed gem/ruby:

# Uninstall the local cocoapods gem
sudo gem uninstall cocoapods

# Reinstall cocoapods via Homebrew
brew install cocoapods

The preinstalled ruby is deprecated since MacOS Catalina: https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes/

See also: https://www.freecodecamp.org/news/do-not-use-mac-system-ruby-do-this-instead/

Kristian
  • 467
  • 3
  • 7
  • thanks for responding. I uninstalled cocoapods and reinstalled it via homebrew as per your suggestion, but now, my flutter build has the following error: 'CocoaPods minimum required version 1.10.0 or greater not installed. Skipping pod install.' I checked the version of cocoapods that was installed and its 1.5.2. Is there a specific switch to be passed to get the latest version of cocoapods via homebrew? – Jose Dec 26 '22 at 08:12
  • That is strange. `brew install cocoapods` should give you the latest version, which is 1.11.3 (stable): https://formulae.brew.sh/formula/cocoapods Maybe try: `brew update` `brew doctor` `brew upgrade cocoapods` – Kristian Dec 29 '22 at 11:44