1

I have a react-native project with these dependencies (all are the latest available):

    "@react-native-firebase/analytics": "^14.5.1",
    "@react-native-firebase/app": "^14.5.1",
    "@react-native-firebase/config": "^0.1.5",
    "@react-native-firebase/perf": "^14.5.1",

But when I go to pod install, I get:

[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In Podfile:
    RNFBApp (from `../node_modules/@react-native-firebase/app`) was resolved to 14.5.1, which depends on
      Firebase/CoreOnly (= 8.12.1)

    RNFBConfig (from `../node_modules/@react-native-firebase/config`) was resolved to 0.1.5, which depends on
      Firebase/RemoteConfig (~> 6.5.0) was resolved to 6.5.0, which depends on
        Firebase/CoreOnly (= 6.5.0)

I do not understand why config has a different version to all the others and how the latest versions of a project are conflicting.

I have tried the following to fix this: rm -rf ios/Pods ios/Podfile.lock pod repo remove trunk pod install pod update pod install --repo-update

My ios/Podfile does not contain explicit pods for Firebase.

Usually these commands tend to fix problems like this. But not this time. Thanks for any suggestions.

Karatekid430
  • 940
  • 11
  • 25
  • Have you tried this? Edit the minimum ios version in the podfile then run pod install. Changing platform :ios, '9.0' to platform :ios, '10.0' then running pod install – fixedDrill Mar 15 '22 at 05:56
  • try the other solutions from here. [CocoaPods could not find compatible versions for pod "Firebase/CoreOnly"](https://stackoverflow.com/questions/56055142/cocoapods-could-not-find-compatible-versions-for-pod-firebase-coreonly) – fixedDrill Mar 15 '22 at 05:58
  • The iOS version is already 11 in my file. None of the answers in that question work and lots of the answers are mistakenly attributing M1 chip. – Karatekid430 Mar 15 '22 at 06:10

4 Answers4

2

react-native-firebase maintainer here!

The 'config' package was wrapping the firebase "Remote Config" SDK packages, so that name was not used in the final release of react-native-firebase - we used "remote-config" in the end, but the alpha releases with the wrong name were still up on npmjs.com.

I just deprecated all versions of that package on npmjs.com so users should get a warning if they try to install it - no one should use that package. If you use the 'remote-config' one, you'll be all set I think

Mike Hardy
  • 2,274
  • 3
  • 25
  • 57
0

The problem is that @react-native-firebase/config appears unrelated to the @react-native-firebase project, hence the different latest version and pod conflicts. I had to use @react-native-firebase/remote-config instead, as found in the documentation https://github.com/invertase/react-native-firebase

Karatekid430
  • 940
  • 11
  • 25
0

The problem is that react native update a new architecture

  • Open the file Podfile and add use_frameworks! :linkage => :static inside your targets
  • Disable the :flipper_configuration line
  • Put $RNFirebaseAsStaticFramework = true at the top of podfile

Then run

pod install --repo-update

For Mac M1

arch -x86_64 pod install --repo-update

Hope this useful to someone

Alex Yapryntsev
  • 589
  • 6
  • 19
vanhai
  • 1
  • 2
0

I solved the issue by deleting the ./ios/Podfile.lock and run again pod install --repo-update command.

Joel Ambu
  • 55
  • 5