ios - Flutter IOS Cocoapods '来自 Cocoapods 的错误输出:'
问题描述
我在模拟器上运行我的 iOS 应用程序没有问题。在我尝试实现 facebook 登录后,我的 Flutter 项目开始需要安装 Cocoapods。
安装 Cocoapod 后,我尝试flutter run
在 iOS 模拟器上安装,但出现此错误:
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 的情况下可以正常运行,而今天必须在我的模拟器上运行?现在我得到了所有这些错误!
PS:我的 Podfile 已经配置好了plataform: ios, '9.0'
,我在 ios 中没有开发者账号。
解决方案
我找到了解决方案。
在项目路径上,打开终端并运行gem install ffi
在 Podfile 目录运行arch -x86_64 pod install
或pod install
终端上
推荐阅读
- oauth-2.0 - Angular 9 在加载页面上抛出 CORS 错误
- ios - 是否有适用于 iOS 应用程序的 Invisible reCaptcha?(不需要用户点击)
- python - BadRequest:比特币双查询中的 400 语法错误
- python - 让只有颜色不同的海龟做一些不同的事情
- android - IndexedDB 在 WebView 中不起作用 - 为什么?
- java - 如何通过maven surefire插件运行选定的suiteXmlFile
- reactjs - 为什么 Axios 承诺没有在 React 中按顺序执行
- node.js - 为什么 node-sp-auth on demand 不显示浏览器窗口?
- apache-flink - 当时间特征为事件时间时,如何获取事件的摄取时间?
- node.js - 在回调中设置反应状态不能按预期工作