Karatekid430
Karatekid430

Reputation: 1120

@react-native-firebase pod version conflict for Firebase/CoreOnly

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.

Upvotes: 1

Views: 8962

Answers (5)

Hoàng Rio
Hoàng Rio

Reputation: 1

please run command:

rm -rf Pods Podfile.lock

pod install --repo-update

Upvotes: 0

Joel Ambu
Joel Ambu

Reputation: 115

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

Upvotes: 5

vanhai
vanhai

Reputation: 21

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

Upvotes: 1

Mike Hardy
Mike Hardy

Reputation: 2422

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

Upvotes: 3

Karatekid430
Karatekid430

Reputation: 1120

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

Upvotes: 0

Related Questions