CocoaPods 找不到 pod“FBSDKLoginKit”的兼容版本

时间:2021-07-09 21:43:11

标签: flutter dart firebase-authentication cocoapods fbsdkloginkit

我正在使用 flutter_login_facebook 1.0.1 插件来启用使用 Facebook 登录我的应用程序。

我在 iOS 设备上尝试设置 Facebook 登录时遇到以下错误。

 pod install
    WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
    Consider adding the following to ~/.profile:

    export LANG=en_US.UTF-8
    
Analyzing dependencies
Pre-downloading: `FirebaseFirestore` from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `8.0.0`
cloud_firestore: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.0.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "FBSDKLoginKit":
  In Podfile:
    flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) was resolved to 2.0.0, which depends on
      FBSDKLoginKit (~> 11.0.0)

    flutter_login_facebook (from `.symlinks/plugins/flutter_login_facebook/ios`) was resolved to 0.5.0, which depends on
      FBSDKLoginKit (~> 9.1)

我尝试了以下可以从 stackoverflow 上的其他帖子中找到的步骤,但没有成功:

  1. 已删除 Pods 文件夹、ios/Podfile 文件和 ios/Podfile.lock 文件。
  2. 已执行 flutter clean 命令。
  3. 已执行 flutter pub get 命令。
  4. 尝试使用以下命令 pod update FBSDKCoreKitpod update FBSDKLoginKitpod repo update 进行更新。
  5. 执行pod install

以下是我的Podfile的内容:

# Uncomment this line to define a global platform for your project
platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.0.0'
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

请在下面找到有关我的 flutter 和 dart 版本的详细信息:

Flutter 2.2.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d79295af24 (4 weeks ago) • 2021-06-11 08:56:01 -0700
Engine • revision 91c9fc8fe0
Tools • Dart 2.13.3

谁能帮我解决这个问题。提前感谢您的帮助。

0 个答案:

没有答案