CocoaPods could not find compatible versions for pod "Firebase/Everything"
Asked Answered
T

8

12

I am getting this error when I am trying to run my React Native app in iOS:

[!] CocoaPods could not find compatible versions for pod "Firebase/Auth":
  In Podfile:
    Firebase/Auth

    RNFBAuth (from `../node_modules/@react-native-firebase/auth`) was resolved to 10.5.1, which depends on
      Firebase/Auth (~> 7.4.0)

CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In Podfile:
    Firebase/Crash was resolved to 5.0.0, which depends on
      Firebase/Core (= 5.0.0) was resolved to 5.0.0, which depends on
        Firebase/CoreOnly (= 5.0.0)

    RNFBApp (from `../node_modules/@react-native-firebase/app`) was resolved to 10.5.0, which depends on
      Firebase/CoreOnly (~> 7.4.0)

    RNFBDatabase (from `../node_modules/@react-native-firebase/database`) was resolved to 10.5.1, which depends on
      Firebase/Database (~> 7.4.0) was resolved to 7.4.0, which depends on
        Firebase/CoreOnly (= 7.4.0)

CocoaPods could not find compatible versions for pod "Firebase/Database":
  In Podfile:
    Firebase/Database

    RNFBDatabase (from `../node_modules/@react-native-firebase/database`) was resolved to 10.5.1, which depends on
      Firebase/Database (~> 7.4.0)

CocoaPods could not find compatible versions for pod "Firebase/Firestore":
  In Podfile:
    Firebase/Firestore

    RNFBFirestore (from `../node_modules/@react-native-firebase/firestore`) was resolved to 10.5.1, which depends on
      Firebase/Firestore (~> 7.4.0)

CocoaPods could not find compatible versions for pod "Firebase/Messaging":
  In Podfile:
    Firebase/Messaging

    RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`) was resolved to 10.5.1, which depends on
      Firebase/Messaging (~> 7.4.0)

CocoaPods could not find compatible versions for pod "Firebase/Storage":
  In Podfile:
    Firebase/Storage

    RNFBStorage (from `../node_modules/@react-native-firebase/storage`) was resolved to 10.5.1, which depends on
      Firebase/Storage (~> 7.4.0)

CocoaPods could not find compatible versions for pod "FirebaseCore":
  In Podfile:
    Firebase/Crash was resolved to 3.9.0, which depends on
      Firebase/Core (= 3.9.0) was resolved to 3.9.0, which depends on
        FirebaseCore (= 3.4.4)

    RNFBDatabase (from `../node_modules/@react-native-firebase/database`) was resolved to 10.5.1, which depends on
      Firebase/Database (~> 7.4.0) was resolved to 7.4.0, which depends on
        Firebase/CoreOnly (= 7.4.0) was resolved to 7.4.0, which depends on
          FirebaseCore (= 7.4.0)

    RNFBDatabase (from `../node_modules/@react-native-firebase/database`) was resolved to 10.5.1, which depends on
      Firebase/Database (~> 7.4.0) was resolved to 7.4.0, which depends on
        FirebaseDatabase (~> 7.4.0) was resolved to 7.4.0, which depends on
          FirebaseCore (~> 7.0)

CocoaPods could not find compatible versions for pod "FirebaseInstanceID":
  In Podfile:
    Firebase/Crash was resolved to 3.2.0, which depends on
      FirebaseCrash (= 1.0.4) was resolved to 1.0.4, which depends on
        FirebaseInstanceID (~> 1.0)

    RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`) was resolved to 10.5.1, which depends on
      Firebase/Messaging (~> 7.4.0) was resolved to 7.4.0, which depends on
        FirebaseMessaging (~> 7.4.0) was resolved to 7.4.0, which depends on
          FirebaseInstanceID (~> 7.0)

My package.json is:

{
  "name": "prueba3000",
  "version": "1.1.0",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "eslint": "eslint **/*.tsx **/*.ts",
    "build-testing": "cd android && ./gradlew assembleRelease",
    "build-android": "cd android && ./gradlew bundleRelease",
    "clean": "cd android && ./gradlew clean",
    "postinstall": "npx jetify"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.28",
    "@fortawesome/free-solid-svg-icons": "^5.13.0",
    "@fortawesome/react-native-fontawesome": "^0.2.3",
    "@react-native-community/async-storage": "^1.9.0",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^3.0.8",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/hooks": "^2.6.0",
    "@react-native-community/image-editor": "^2.3.0",
    "@react-native-community/masked-view": "^0.1.7",
    "@react-native-community/slider": "^3.0.3",
    "@react-native-firebase/app": "^10.5.0",
    "@react-native-firebase/auth": "^10.5.1",
    "@react-native-firebase/database": "^10.5.1",
    "@react-native-firebase/firestore": "^10.5.1",
    "@react-native-firebase/messaging": "^10.5.1",
    "@react-native-firebase/storage": "^10.5.1",
    "@react-navigation/native": "^5.1.3",
    "@react-navigation/stack": "^5.2.6",
    "@types/bcrypt": "^3.0.0",
    "bcrypt": "^5.0.0",
    "json2formdata": "^1.0.4",
    "lottie-ios": "^3.1.3",
    "lottie-react-native": "^3.3.2",
    "moment": "^2.24.0",
    "object-to-formdata": "^4.1.0",
    "react": "17.0.1",
    "react-native": "^0.63.4",
    "react-native-camera": "^3.31.0",
    "react-native-countdown-component": "^2.7.1",
    "react-native-device-info": "^7.3.1",
    "react-native-document-picker": "^4.1.0",
    "react-native-fs": "^2.16.6",
    "react-native-gesture-handler": "^1.9.0",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modal-datetime-picker": "^9.1.0",
    "react-native-progress": "^4.1.2",
    "react-native-reanimated": "^2.0.0-alpha.9.2",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.4.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^12.0.3",
    "react-native-video": "^5.1.0-alpha8",
    "react-native-video-controls": "^2.6.0",
    "rn-fetch-blob": "^0.12.0",
    "sprintf-js": "^1.1.2",
    "tipsi-stripe": "^7.5.3"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/plugin-proposal-optional-chaining": "^7.9.0",
    "@babel/runtime": "^7.8.7",
    "@react-native-community/eslint-config": "^2.0.0",
    "@svgr/cli": "^5.2.0",
    "@types/jest": "^26.0.16",
    "@types/react": "^17.0.0",
    "@types/react-native": "^0.63.37",
    "@types/react-test-renderer": "^17.0.0",
    "@typescript-eslint/eslint-plugin": "^4.9.0",
    "@typescript-eslint/parser": "^4.9.0",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.15.0",
    "eslint-config-airbnb": "^18.1.0",
    "eslint-plugin-import": "^2.20.1",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.19.0",
    "faker": "^5.1.0",
    "jest": "^26.6.3",
    "jest-transform-stub": "^2.0.0",
    "jetifier": "^1.6.6",
    "metro-react-native-babel-preset": "^0.64.0",
    "react-test-renderer": "17.0.1",
    "typescript": "^4.1.2"
  },
  "jest": {
    "preset": "react-native"
  },
  "type": "module"
}

In my Podfile, I have this: platform :ios, '10.1' And I have tried also with 10.0 and 9.0.

I have run: pod install npx pod install pod install --repo-update and pod update Firebase/core.

When running pod update Firebase/core I got this error: [!] No `Podfile.lock' found in the project directory, run `pod install'.. But I can't do pod install.

If anyone could give a gint of how solve this, I would really appreciate that. Thanks!

Twoply answered 2/2, 2021 at 19:22 Comment(0)
D
21

run command from the project root folder.

if npm

rm -rf node_modules package-lock.json

if yarn

rm -rf node_modules yarn.lock

remove ^ from every package

set package version from the concerned library if that version exists then ok, otherwise set version that actually exists

run command

npm install or yarn install

then

cd ios

run command from ios folder

rm -rf Pods Podfile.lock

then

pod install

Disenchant answered 2/2, 2021 at 20:8 Comment(4)
Thanks!! I followed all the steps and now I can do the pod install. Apparently I have some build issues now, but I think I can handle them by myself. Have a nice day!Twoply
In my case, I need to update my repo as well with "pod repo update" or "pod install --repo-update"Lizalizabeth
its start working now thanksShashaban
For me, what worked is removing version of Firebase service in Podfile, then following these steps except I didnt do the whole: remove ^ from every package set package version from the concerned library if that version exists then ok, otherwise set version that actually existsBeckford
R
21

I had a similar issue with with the error CocoaPods could not find compatible versions for pod "Firebase/Database" ....

Running pod repo update and then pod install resolved the issue.

Redolent answered 13/9, 2021 at 3:2 Comment(0)
S
3

I having same issue when installing pod, see below error.

enter image description here

[!] CocoaPods could not find compatible versions for pod "Stripe": In Podfile: Stripe (~> 23.8.0)

I fixed and working,

  • required a higher minimum deployment target.
  • Xcode -> General -> Minimun Deployments Target
  • Select iOS target higher e.g 13.0.

Thank You!

Sumer answered 21/7, 2023 at 10:7 Comment(0)
I
1

Remove the reference to Firebase/Crash.

It was deprecated a few years ago in favor of Firebase/Crashlytics

Infirmary answered 2/2, 2021 at 23:49 Comment(1)
Thanks! That helped. I still have some problems aynway, but I think I can handle them mysellf. Have a nice day!Twoply
B
1

In my case removing Podfile.lock helped. But this operation is quite unsafe.

Borg answered 7/8, 2021 at 13:46 Comment(2)
In what way is it unsafe? Please elaborate.Darbydarce
@TashPemhiwa Podfile.lock freezes all the versions of dependencies including pods without explicitly specified versions. There is no guarantee that pod install provides exactly the same pod versions and you could successfully compile your project.Borg
L
1

I know this is old, but none of the above worked for me. What worked was adding the following to the plugins section inside app.json:

       [
        "expo-build-properties",
         {
          "ios": {
             "useFrameworks": "static"
           }
         }
       ]

Hopefully this helps someone!

Libna answered 8/1, 2023 at 12:20 Comment(0)
C
1

Here are the steps you can take to resolve this issue:

Run the following command to update your CocoaPods source repositories to the latest versions:

pod repo update

Update Pods: After updating the repositories, update the pods in your project:

pod update

Clean and Reinstall Pods: If the issue persists, you can try cleaning and reinstalling the pods:

rm -rf Pods Podfile.lock
pod install

Here is a summary of the commands to run:

pod repo update
pod update
rm -rf Pods Podfile.lock
pod install
Cornstalk answered 29/7 at 11:56 Comment(0)
G
-1

if you use NotificationExtension in pod file note the version is used in here after commented try to run pod install then uncomment and run pod install once more

Gate answered 27/9, 2023 at 12:17 Comment(1)
# target 'NotificationExtension' do # pod 'Firebase/Messaging', '~> 18.3.0' # eg 6.31.0 # endGate

© 2022 - 2024 — McMap. All rights reserved.