首页 > 解决方案 > flutter_facebook_login CocoaPods 依赖错误

问题描述

我正在尝试将 facebook 登录添加到 Flutter 应用程序。我正在使用flutter_facebook_login。但是当我尝试为 iOS 构建时给出错误:

    Resolving dependencies of `Podfile`
    [!] CocoaPods could not find compatible versions for pod "FBSDKLoginKit":
      In Podfile:
        flutter_facebook_login (from `.symlinks/plugins/flutter_facebook_login/ios`) was resolved to 0.0.1, which depends on
          FBSDKLoginKit (= 4.39.1)

    None of your spec sources contain a spec satisfying the dependency: `FBSDKLoginKit (= 4.39.1)`.

    You have either:
     * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
     * mistyped the name or version.
     * not added the source repo that hosts the Podspec to your Podfile.




Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update

Error running pod install
Error launching application on iPhone X.

我没有手动安装 pod,因为flutter_facebook_login自述文件说:

(注意:您可以跳过“第 2 步:设置您的开发环境”)。

有人帮忙吗?谢谢!

标签: facebookdartflutterfacebook-loginflutter-plugin

解决方案


根据这个diegoveloper的回答flutter_facebook_login github问题。

https://github.com/roughike/flutter_facebook_login/issues/201

  • flutter clean
  • 删除ios/Podfile.lock文件
  • 转到Podfile文件并从更改platform :ios, '9.0'platform :ios, '11.0' (在我的情况下,一些库不支持 11.0,我使用平台:ios,'9.0 然后将 runner.xcsworkspace 中的部署目标设置为 9.0 并且它可以工作。)
  • 转到终端,ios目录并运行pod install
  • 再次运行项目。

推荐阅读