Home > Back-end >  Add crashlytics to react native project throws an error
Add crashlytics to react native project throws an error

Time:11-10

I am using multiple firebase services on my react native project. Now I tried to add crashlytics

yarn add @react-native-firebase/crashlytics

But I get an error

[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In snapshot (Podfile.lock):
    Firebase/CoreOnly (= 8.12.1)

  In Podfile:
    RNFBApp (from `../node_modules/@react-native-firebase/app`) was resolved to 16.4.3, which depends on
      Firebase/CoreOnly (= 10.1.0)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `RNFBApp`.
   You should run `pod update Firebase/CoreOnly` to apply changes you've made.

This is how my package.json looks like

"@react-native-firebase/app": "^16.4.3",
    "@react-native-firebase/auth": "^14.5.0",
    "@react-native-firebase/crashlytics": "^16.4.3",
    "@react-native-firebase/database": "^14.9.3",
    "@react-native-firebase/dynamic-links": "^16.4.3",
    "@react-native-firebase/firestore": "^14.5.1",
    "@react-native-firebase/messaging": "^16.4.3",
    "@react-native-firebase/storage": "^14.9.0",

I found multiple discussion with the same problem but nothing helped. I changed platform :ios, '12.1' to platform :ios, '13.0' in pod file. Pod update, and pod install commands also did't helped.

CodePudding user response:

Please check if below method works

  1. Delete the ios/Podfile.lock
  2. Run pod install --repo-update command.
  • Related