8

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!

4 Answers 4

25

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.
Sign up to request clarification or add additional context in comments.

1 Comment

Make sure "platform :ios, '11.0'" line is not commented out.
4

just update your podfile .

platform :ios, '11.0'

try to pod install again in terminal. pod install

Comments

2

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 protected]' }
  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

3 Comments

Thanks for reply! I have not try this yet. Is safe to modify this? If flutter_facebook_login get new update, will also update this? Or is lock?
Well I make this change in a project some time ago and until currents days is all good. About updates it's hard too say because before you make this changes the plugin version is already locked right...? You can make some tests about it but I can grant that with this changes you will get a build successfully.
Thanks for reply! I am ask because I want make sure dependency is update when it get new version (for example when author release version 2.1.0)
2
  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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.