Compatible versions for pod "FBSDKCoreKit" - "react-native-fbsdk-next"

1.3k Views Asked by At

Error after adding the 'react-native-fbsdk-next' dep in order to add facebook sign-in method to an app:

[!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit":
  In Podfile:
    EXFacebook (from `../node_modules/expo-facebook/ios`) was resolved to 12.2.0, which depends on
      FacebookSDK/CoreKit (= 9.2.0) was resolved to 9.2.0, which depends on
        FBSDKCoreKit (~> 9.2.0)

    ExpoAdapterFBSDKNext (from `../node_modules/react-native-fbsdk-next/ios`) was resolved to 11.1.0, which depends on
      FBSDKCoreKit

    react-native-fbsdk-next (from `../node_modules/react-native-fbsdk-next`) was resolved to 11.1.0, which depends on
      react-native-fbsdk-next/Core (= 11.1.0) was resolved to 11.1.0, which depends on
        FBSDKCoreKit (~> 15.0.0)

    react-native-fbsdk-next (from `../node_modules/react-native-fbsdk-next`) was resolved to 11.1.0, which depends on
      react-native-fbsdk-next/Login (= 11.1.0) was resolved to 11.1.0, which depends on
        FBSDKLoginKit (~> 15.0.0) was resolved to 15.0.0, which depends on
          FBSDKCoreKit (= 15.0.0)

package.json:

{
  "name": "app",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "prebuild": "expo prebuild",
    "eject": "expo eject"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.5.2",
    "@react-native-community/hooks": "^2.8.1",
    "@react-native-google-signin/google-signin": "^8.2.1",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/native-stack": "^6.7.0",
    "axios": "^0.27.2",
    "expo": "~47.0.8",
    "expo-facebook": "^12.2.0",
    "expo-image-picker": "~14.0.2",
    "expo-splash-screen": "~0.17.5",
    "expo-status-bar": "~1.4.2",
    "expo-system-ui": "~2.0.1",
    "formik": "^2.2.9",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-date-picker": "^4.2.3",
    "react-native-fbsdk-next": "^11.1.0",
    "react-native-image-picker": "^4.8.4",
    "react-native-modal-datetime-picker": "^13.1.2",
    "react-native-popup-menu": "^0.15.12",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-select-dropdown": "^2.0.4",
    "react-native-vision-camera": "^2.14.0",
    "react-native-web": "~0.18.7",
    "react-social-icons": "^5.15.0"
  },
  "devDependencies": {
    "pod-install": "^0.1.38",
    "@babel/core": "^7.19.3",
    "@types/react": "~18.0.24",
    "@types/react-native": "~0.70.6",
    "eslint-plugin-react": "^7.31.11",
    "typescript": "^4.6.3"
  },
  "private": true
}

Command to run:

npm i 
npx run prebuild

Cocoapods failed to init the ios project dir. Cannot install the new dep react-native-fbsdk-next and add a Facebook sign-in to a react native project.

Worked as the official docs stated in expo-installation section.

1

There are 1 best solutions below

0
Maor Meir Hajaj On
EXFacebook (from `../node_modules/**expo-facebook**/ios`) was resolved to 12.2.0, which depends on
      FacebookSDK/CoreKit (= 9.2.0) was resolved to 9.2.0, which depends on
        FBSDKCoreKit (~> 9.2.0)

Expo-facebook is deprecated - removed that dependency, and everything works.