将“google_sign_in”包添加到Flutter应用程序(iOS变体)时,Cocoapods分段错误

cvxl0en2  于 2022-12-24  发布在  Flutter
关注(0)|答案(1)|浏览(155)

当我添加google_sign_in包时,我无法编译我的Flutter应用程序(iOS变体)。起初,症状与f f i pod有关(不管它们是什么)。根据产生的错误消息,我卸载了ffi,然后使用**--enable-libffi-alloc**开关重新安装,如下所示:



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]

我一直在寻找以上问题的解决方案,共识似乎指向一些pod与我的M1处理器不兼容。过去一天我尝试了很多建议,但都无济于事,我束手无策。我希望有人能帮上忙。


我的环境如下:



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


提前感谢您的任何建议。


/何塞


hc2pp10m

hc2pp10m1#

我遇到了同样的问题,只是与firebase_core包。
解决方案与https://stackoverflow.com/a/65334677/515239相同
通过Homebrew安装cocopods,而不是使用系统安装的gem/ruby:

# Uninstall the local cocoapods gem
sudo gem uninstall cocoapods

# Reinstall cocoapods via Homebrew
brew install cocoapods

自MacOS Catalina 起,预装的ruby已弃用:https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes/
另请参阅:https://www.freecodecamp.org/news/do-not-use-mac-system-ruby-do-this-instead/

相关问题