flutter_facebook_login CocoaPods dependency error

非 Y 不嫁゛ 提交于 2021-02-07 12:24:24

问题


I am try add facebook login to Flutter app. I am use flutter_facebook_login. But when I try build for iOS give error:

    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.

I no install pod manually because flutter_facebook_login readme say:

(Note: you can skip "Step 2: Set up Your Development Environment").

Anyone help? Thanks!


回答1:


According to this diegoveloper's answer flutter_facebook_login github issue.

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

  • flutter clean
  • Remove ios/Podfile.lock file
  • Go to the Podfile file and changed from platform :ios, '9.0' to platform :ios, '11.0' (In my case, some libs don't support 11.0 and I use platform :ios, '9.0 then set deployment target in runner.xcsworkspace to 9.0 and it work.)
  • Go to the terminal , ios directory and run pod install
  • Run the project again.



回答2:


just update your podfile .

platform :ios, '11.0'

try to pod install again in terminal. pod install




回答3:


  1. open terminal and go to root package directory using cd the_root_package_path
  2. type flutter clean
  3. open podfile and uncomment : # platform :ios, '11.0'
  4. run pod install

had the same problem, tried everything, this worked for me.




回答4:


I had this problem some time ago and I was able to solve this with a manual approach. Make sure that you have in your pubspec.yaml flutter_facebook_login: ˆ2.0.0 declared and getted.

In your project root directory navigate to ios > .symlinks > plugins > flutter_facebook_login > ios > flutter_facebook_login.podspec

You will change some fields inside flutter_facebook_login.podspec.

s.version          = '2.0.0'

and

s.dependency 'FBSDKLoginKit', '~> 4.29'

after this in your osx box inside of ios directory of your project run pod deintegrate and pod update return to root project directory run flutter clean and try to build your project again.

Here is an example of my flutter_facebook_login.podspec that works fine into one of my projects. I hope it helps.

# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
  s.name             = 'flutter_facebook_login'
  s.version          = '2.0.0'
  s.summary          = 'A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.'
  s.description      = <<-DESC
A Flutter plugin for allowing users to authenticate with native Android &amp; iOS Facebook login SDKs.
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => 'email@example.com' }
  s.source           = { :path => '.' }
  s.source_files = 'Classes/**/*'
  s.public_header_files = 'Classes/**/*.h'
  s.dependency 'Flutter'
  s.dependency 'FBSDKLoginKit', '~> 4.29'

  # https://github.com/flutter/flutter/issues/14161
  #s.static_framework = true

  s.ios.deployment_target = '8.0'
end


来源:https://stackoverflow.com/questions/55596988/flutter-facebook-login-cocoapods-dependency-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!