Flutter_facebook_login: fatal error: module 'FBSDKCoreKit' not found

Created on 12 Nov 2019  Â·  15Comments  Â·  Source: roughike/flutter_facebook_login

Hi, after i upgraded to 3.0.0 i started getting this error:

    ** BUILD FAILED **
Xcode's output:
↳
    In file included from /Users/erolasan/Work/lvlup/lvlupmobile/ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/_FBSDKLoginRecoveryAttempter.m:21:
    In file included from /Users/erolasan/Work/lvlup/lvlupmobile/ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/FBSDKLoginKit+Internal.h:19:
   In file included from /Users/erolasan/Work/lvlup/lvlupmobile/ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/Internal/../FBSDKLoginKit.h:27:
    /Users/erolasan/Work/lvlup/lvlupmobile/ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginButton.h:24:9: 
fatal error: module 'FBSDKCoreKit' not found
    @import FBSDKCoreKit;
     ~~~~~~~^~~~~~~~~~~~
    1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone 8.

I've done a full clean/reset of Pods and pod cache, but error still shows

Most helpful comment

I have managed to solve this issue by changing the Podfile

target 'Runner' do
# Flutter Pod
use_frameworks!
use_modular_headers!
------

Flutter clean
Delete Podfile.lock
pod install --repo-update
pod update FBSDKLoginKit

open .xcworkspace and in General-> Deployment Info set Target 11.0 also in Podfile set Target 11.0

All 15 comments

I have the same problem!any guys can tell me how to do?

I have managed to solve this issue by changing the Facebook Pod versions from 5.10.0 to 5.8.0 on the Podfile. The solution is from this issue, you can check it for more details.
My new Podfile looks like below.

PODS:
  - FBSDKCoreKit (5.8.0):
    - FBSDKCoreKit/Basics (= 5.8.0)
    - FBSDKCoreKit/Core (= 5.8.0)
  - FBSDKCoreKit/Basics (5.8.0)
  - FBSDKCoreKit/Core (5.8.0):
    - FBSDKCoreKit/Basics
  - FBSDKLoginKit (5.8.0):
    - FBSDKLoginKit/Login (= 5.8.0)
  - FBSDKLoginKit/Login (5.8.0):
    - FBSDKCoreKit (~> 5.0)
  - Flutter (1.0.0)
....

I have managed to solve this issue by changing the Facebook Pod versions from 5.10.0 to 5.8.0 on the Podfile. The solution is from this issue, you can check it for more details.
My new Podfile looks like below.

PODS:
  - FBSDKCoreKit (5.8.0):
    - FBSDKCoreKit/Basics (= 5.8.0)
    - FBSDKCoreKit/Core (= 5.8.0)
  - FBSDKCoreKit/Basics (5.8.0)
  - FBSDKCoreKit/Core (5.8.0):
    - FBSDKCoreKit/Basics
  - FBSDKLoginKit (5.8.0):
    - FBSDKLoginKit/Login (= 5.8.0)
  - FBSDKLoginKit/Login (5.8.0):
    - FBSDKCoreKit (~> 5.0)
  - Flutter (1.0.0)
....

Thanks!!!!

Same problem here

I don't think we should modify version and dependencies, the fix is just to add a FBSDKCOCOAPODS define so newer FBSDK compile fine.

See my related pull request here: https://github.com/roughike/flutter_facebook_login/pull/217

Unfortunately this pull request is still not accepted. What I personally did, in the mean time, is forked the solution and define my flutter dependency on my repo (which has the modification committed) like this in pubspec.yaml:

dependencies:
  flutter:
  ...
  flutter_facebook_login:
    git:
      url: https://github.com/smourier/flutter_facebook_login
  ...

This solution worked for me as well.

I am facing the same issue, unfortunately upgrading the pod version causes different errors for me.

The solution of @atavci suggested worked finally for me, it seems that an issue with Facebook SDK itself.
I had to update the versions inside the Podfile.lock manually to the following
```PODS:

  • FBSDKCoreKit (5.8.0):

    • FBSDKCoreKit/Basics (= 5.8.0)

    • FBSDKCoreKit/Core (= 5.8.0)

  • FBSDKCoreKit/Basics (5.8.0)
  • FBSDKCoreKit/Core (5.8.0):

    • FBSDKCoreKit/Basics

  • FBSDKLoginKit (5.8.0):

    • FBSDKLoginKit/Login (= 5.8.0)

  • FBSDKLoginKit/Login (5.8.0):

    • FBSDKCoreKit (~> 5.0)

  • Flutter (1.0.0)
  • flutter_facebook_login (0.0.1):

    • FBSDKCoreKit (~> 5.5)

    • FBSDKLoginKit (~> 5.5)

    • Flutter```

I have changed all FBSDK** to 5.8.0, You may need to call pod update FBSDKCoreKit in order to force the update of the PODs

Looks like that's https://github.com/facebook/facebook-ios-sdk/issues/1102 and the solution is to have

pod 'FBSDKCoreKit', :modular_headers => true

in this plugins' .podspec.

Until this is done, you can workaround by enabling modular_headers globally in your application's ios/Podspec file with

# Somewhere at the top of the file, I put it next to "platform :ios ..."

use_modular_headers!

Looks like that's facebook/facebook-ios-sdk#1102 and the solution is to have

pod 'FBSDKCoreKit', :modular_headers => true

in this plugins' .podspec.

Until this is done, you can workaround by enabling modular_headers globally in your application's ios/Podspec file with

# Somewhere at the top of the file, I put it next to "platform :ios ..."

use_modular_headers!

Sorry, this didn't work for me as it generated a conflict with other library (Boring-SSL) which is used by some Firebase library in my project.

Any news on this? I'm still running into this issue.

I have managed to solve this issue by changing the Facebook Pod versions from 5.10.0 to 5.8.0 on the Podfile. The solution is from this issue, you can check it for more details.
My new Podfile looks like below.

PODS:
  - FBSDKCoreKit (5.8.0):
    - FBSDKCoreKit/Basics (= 5.8.0)
    - FBSDKCoreKit/Core (= 5.8.0)
  - FBSDKCoreKit/Basics (5.8.0)
  - FBSDKCoreKit/Core (5.8.0):
    - FBSDKCoreKit/Basics
  - FBSDKLoginKit (5.8.0):
    - FBSDKLoginKit/Login (= 5.8.0)
  - FBSDKLoginKit/Login (5.8.0):
    - FBSDKCoreKit (~> 5.0)
  - Flutter (1.0.0)
....

Even using 5.13.0 version the problem persist. This is the only solution that worked for me until now

Neither solution worked for me. flutter clean, clear DerivedData, pod deintegrate, then even tried explicitly stating FBSDK* to be 5.8.0 and set modular header to true in podfile did not do the trick. App is still running perfectly fine in the iOS/Android emulators.

pod 'FBSDKCoreKit', '5.8.0', :modular_headers => true
pod 'FBSDKLoginKit', '5.8.0'

Any other suggestions?

For anyone that this issue still happens, can you guys try to add use_frameworks! after platform :ios, '9.0' as a new line to see whether it fixes the issue? Here is an example Podfile

platform :ios, '9.0'

use_frameworks!

target 'ASRIOS' do

  # Pods for ASRIOS
  pod 'FBSDKCoreKit', '5.11.1'
  pod 'FBSDKLoginKit', '5.11.1'
  pod 'FBSDKShareKit', '5.11.1'

  target 'ASRIOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ASRIOSUITests' do
    # Pods for testing
  end

end

I have managed to solve this issue by changing the Podfile

target 'Runner' do
# Flutter Pod
use_frameworks!
use_modular_headers!
------

Flutter clean
Delete Podfile.lock
pod install --repo-update
pod update FBSDKLoginKit

open .xcworkspace and in General-> Deployment Info set Target 11.0 also in Podfile set Target 11.0

Was this page helpful?
0 / 5 - 0 ratings