ios - Flutter IOS Cocoapods 'Error output from Cocoapods:'

标签 ios flutter cocoapods

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

安装 Cocoapod 后,我尝试在 iOS 模拟器上 flutter run,但出现此错误:

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...                                           2.043ms
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 flutter_facebook_auth from .symlinks/plugins/flutter_facebook_auth/ios

    Resolving dependencies of Podfile

Error output from CocoaPods:
↳
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require':
    dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle, 9): no suitable image found.  Did find: (LoadError)
        /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle: mach-o, but wrong architecture
        /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle: mach-o, but wrong architecture -... etc

为什么我没有安装这个 Cocoapods 就可以正常运行,今天却需要在我的 Emulator 上运行?现在我遇到了所有这些错误!

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

最佳答案

我找到了解决方案。

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

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

关于ios - Flutter IOS Cocoapods 'Error output from Cocoapods:',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69059030/

相关文章:

ios - UIScrollview 不会水平滚动

android - Flutter "packages get"失败,错误 "Couldn' t 读取文件本地文件...”

ios - Xcode 未在正确的子目录中搜索 header

ios - 更改多个平台 iOS 的背景图像

dart - 重新打开使用 StreamBuilder 的 ExpansionTile 时流的错误状态

ios - SimpleAuth pod 未正确安装

ios - 在 OS X 上安装 OpenSSL 时出现架构不支持错误

ios - SQLite:从 API 存储数据时应该使用 Integer 主键还是 Integer?

ios - 调整自定义导航后退按钮的位置

json - 未处理的异常:类型 '_InternalLinkedHashMap<String, dynamic>'不是类型转换中类型 'List<dynamic>'的子类型吗?