Flutter IOS Cocoapods“Cocoapods 的错误输出:”

Den*_*Ken 4 ios cocoapods flutter

我在模拟器上运行我的 iOS 应用程序没有问题。\n在我尝试实现 facebook 登录后,我的 Flutter 项目开始要求安装 Cocoapods。

\n

安装 Cocoapod 后,我尝试flutter run在 iOS 模拟器上运行,但收到​​此错误:

\n
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...\nRunning pod install...                                           2.043ms\nCocoaPods' output:\n      Preparing\n\n    Analyzing dependencies\n\n    Inspecting targets to integrate\n      Using ARCHS setting to build architectures of target Pods-Runner: (``)\n\n    Fetching external sources\n    -> Fetching podspec for Flutter from Flutter\n    -> Fetching podspec for flutter_facebook_auth from .symlinks/plugins/flutter_facebook_auth/ios\n\n    Resolving dependencies of Podfile\n\nError output from CocoaPods:\n\xe2\x86\xb3\n    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require':\n    dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle, 9): no suitable image found.  Did find: (LoadError)\n        /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle: mach-o, but wrong architecture\n        /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle: mach-o, but wrong architecture -... etc\n
Run Code Online (Sandbox Code Playgroud)\n

为什么我在没有安装 Cocoapods 的情况下运行正常,而今天却需要在我的模拟器上运行?现在我遇到了所有这些错误!

\n

PS:我的 Podfile 已经配置好了plataform: ios, '9.0',但我在 ios 中没有开发者帐户。

\n

Den*_*Ken 5

我找到了解决方案。

在项目路径上,打开终端并运行gem install ffi

在 Podfile 目录中运行arch -x86_64 pod installpod install在终端上