analytics-react-native: CocoaPods could not find compatible versions for pod "Analytics"

I recently upgraded my @react-native-firebase/app and @react-native-firebase/messaging to 10.4.0, and since then I’ve not been able to do ‘pod install’. I’ve removed pods, podfile.lock, and also done pod update. I’m stuck with this error:

[!] CocoaPods could not find compatible versions for pod "Analytics":
  In Podfile:
    RNAnalytics (from `../node_modules/@segment/analytics-react-native`) was resolved to 1.3.2, which depends on
      Analytics (~> 4.1)

    RNAnalyticsIntegration-Firebase (from `../node_modules/@segment/analytics-react-native-firebase`) was resolved to 1.3.2, which depends on
      Analytics

    RNAnalyticsIntegration-Firebase (from `../node_modules/@segment/analytics-react-native-firebase`) was resolved to 1.3.2, which depends on
      Segment-Firebase was resolved to 2.4.1, which depends on
        Analytics (~> 3.2)

CocoaPods could not find compatible versions for pod "nanopb":
  In Podfile:
    RNAnalyticsIntegration-Firebase (from `../node_modules/@segment/analytics-react-native-firebase`) was resolved to 1.3.2, which depends on
      Segment-Firebase was resolved to 2.7.0, which depends on
        FirebaseAnalytics (~> 6.1) was resolved to 6.1.2, which depends on
          nanopb (~> 0.3)

    RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`) was resolved to 10.4.0, which depends on
      Firebase/Messaging (~> 7.3.0) was resolved to 7.3.0, which depends on
        Firebase/CoreOnly (= 7.3.0) was resolved to 7.3.0, which depends on
          FirebaseCore (= 7.3.0) was resolved to 7.3.0, which depends on
            FirebaseCoreDiagnostics (~> 7.0) was resolved to 7.3.0, which depends on
              nanopb (~> 2.30906.0)

Podfile:

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'

platform :ios, '11.0'

target 'sofy' do
  config = use_native_modules!
  use_react_native!(:path => config["reactNativePath"])
  use_unimodules!(modules_paths: ['../node_modules'])


  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

Package.json:

"@segment/analytics-react-native": "^1.3.2",
"@segment/analytics-react-native-firebase": "^1.3.2",
"@react-native-firebase/app": "^10.4.0",
"@react-native-firebase/messaging": "^10.4.0",

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 11
  • Comments: 40 (9 by maintainers)

Most upvoted comments

This worked for me:

  • in Podfile change platform :ios, '10.0' to platform :ios, '11.0'
  • in project.pbxproj set all iOS Deployment Targets to 11.0
  • update Firebase and Appcenter versions in package.json
  • delete Podfile.lock to renew Firebase dependencies

@segment/analytics-react-native-firebase integration is still not fixed. It resolves to Segment-Firebase 1.0.0. I get this error when attempting pod install

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

  In Podfile:
    RNAnalyticsIntegration-Firebase (from `../node_modules/@segment/analytics-react-native-firebase`) was resolved to 1.4.3, which depends on
      Segment-Firebase was resolved to 1.0.0, which depends on
        Firebase/Core (~> 3.3.0)

    RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics`) was resolved to 10.4.0, which depends on
      Firebase/Analytics (~> 7.3.0) was resolved to 7.3.0, which depends on
        Firebase/Core (= 7.3.0)

Any help/guidance regarding this will be greatly appreciated.

if anyone get this problem. delete pod lock file with pod folder (remember not pod file) then install agian pod “pod install”

I was able to solve it by just downgrade the platform version required from 11 to 10.

File node_modules/@segment/analytics-react-native/RNAnalytics.podspec

Changed from s.platform = :ios, '11.0' to s.platform = :ios, '10.0'

run pod install again, and it’s working.

Same issue on clean project and latest version of firebase, any help or solution? My setup: “@segment/analytics-react-native”: “^1.5.0”, “@segment/analytics-react-native-firebase”: “^1.5.0”, “@segment/analytics-react-native-mixpanel”: “^1.5.0”, “react”: “17.0.2”, “react-native”: “0.65.1”, “@react-native-firebase/analytics”: “^12.7.3”, “@react-native-firebase/app”: “^12.7.3”, “@react-native-firebase/crashlytics”: “^12.7.3”, “@react-native-firebase/messaging”: “^12.7.3”,

And the error is 
 ```CocoaPods could not find compatible versions for pod "FirebaseAnalytics": In Podfile:
RNAnalyticsIntegration-Firebase (from `../node_modules/@segment/analytics-react-native-firebase`) was resolved to 1.5.0, which depends on
  Segment-Firebase (~> 2.7.7) was resolved to 2.7.7, which depends on
    FirebaseAnalytics (~> 7.7)

RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics`) was resolved to 12.7.3, which depends on
  Firebase/Analytics (= 8.6.0) was resolved to 8.6.0, which depends on
    Firebase/Core (= 8.6.0) was resolved to 8.6.0, which depends on
      FirebaseAnalytics (~> 8.6.0)```

Just a heads up, since you all reported it so much, STRATCONN-544 ended up getting assigned to me. Look for an update soon!

This actually isn’t fixed because @segment/analytics-react-native-firebase uses Segment-Firebase which depends on Analytics (~> 3.2) so the same conflict happens.

fixed, release coming shortly.

@bsneed I’m experiencing the same type of dependency error when attempting to add @segment/analytics-react-native-firebase to my project alongside @react-native-firebase/app (and many other @react-native-firebase/* packages for that matter)

Looks like the packages depend on Firebase/CoreOnly = 5.0.0 and = 7.4.0 respectively.

For context – I’m attempting to follow the “Usage” directions here and hoping send analytics events through Segment instead of direct to Firebase since our app is currently sending many other events being consumed by other destinations.

Seems like you fixed this dependency issue in the Pod described above, so wondering if there is a plan to fix the @segment/analytics-react-native-firebase as well?

Sorry to open this thread back up and if this isn’t the appropriate place for such a question, but wasn’t able to find a repo for that specific library to file an issue.

Thanks in advance for any help/guidance here!

Just pushed a new version of Segment-Firebase to CocoaPods. This should resolve the build problems ya’ll were seeing. Changelog here: https://cocoapods.org/pods/Segment-Firebase#changelog

Thanks @bsneed! Now it works perfectly! Just 💅 - On the changelog there’s a typo on the year:

Version 2.7.1 (5th March, 2021)

@zer0flag sweet! ah crud! it will live in infamy now. :S

Just pushed a new version of Segment-Firebase to CocoaPods. This should resolve the build problems ya’ll were seeing. Changelog here: https://cocoapods.org/pods/Segment-Firebase#changelog

Segment-Firebase is using an out of date version it looks like. We have a ticket internally and that team is looking into it.

I’m still running into the same issue regarding the outdated Segment-Firebase version. When do you think this will be fixed @bsneed? I’m thinking of removing segment at all because firebase is essential for us but actually I don’t want to do that 😃

Segment-Firebase is using an out of date version it looks like. We have a ticket internally and that team is looking into it.

Not really, but I do appreciate the offer! Thanks so much!

I ran pod update Analytics which fixed this issue for me.