[!] CocoaPods could not find compatible versions for pod

Hola hola,

When working with a bare CLI React Native app, I often run into issues during the pod install command.

Currently, I’m getting this CocoaPods could not find compatible versions for pod with: when working on the React Native version of Ampli…


This content originally appeared on DEV Community and was authored by Matt Ruiz

Hola hola,

When working with a bare CLI React Native app, I often run into issues during the pod install command.

Currently, I’m getting this CocoaPods could not find compatible versions for pod with: when working on the React Native version of Amplinks.

Here is the error that I’m getting. Yours could be for non-firebase packages — I’ve had it happen with Sentry/Stripe/etc.

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

  In Podfile:
    RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics`) was resolved to 21.6.1, which depends on
      Firebase/Analytics (= 11.5.0)

The CLI then gives us the following message highlighting potential issues and their fix.

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/Analytics inside your development pod RNFBAnalytics. You should run pod update Firebase/Analytics to apply changes you’ve made.

How to fix CocoaPods could not find compatible versions for pod?

Option 1: Run the command as it says

For me, the pod install — repo-update command somtimes work’s by itself. Note: you will have to run cd ios before running any pod ... command since it will look for a local ./Podfile . Here is an article from Gant at Infinite Red labeled Beginner’s Guide to Using CocoaPods with React Native.

Option 2: Remove some extra files/cache/etc

Other times, I have to:

  1. Delete derived data for the app I’m currently working on: StackOverflow
  2. run pod deintegrate to remove the bad Pods: StackOverflow
  3. Remove node_modules in root of React Native project
  4. Remove ios/Pods , ios/build , and ios/Podfile.lock (maybe even ./yarn.lock or package-lock.json

Summary

The React Native ←→ Xcode environment can be really taxing and can take up hours of your day. I call them config days and they can really dampen momentum.

I would recommend that you take extra time:

  1. To read, and then re-read, the error messages every time. Don’t try to copy and past into Google/ChatGPT right away — you’ve got to know what to look for.
  2. To read through documentation for these base level cli commands and the related environments - try and make sense of those StackOverflow links I shared. They might not make sense now but they will eventually.
  3. Learn about Pods and how they they mirror node_modules behavior but on a native iOS/Xcode/Swift/Objective C level — basic understanding will take you far.

Good luck — hope this was helpful!

Please give a follow on Twitter if you’re in the space!

— Matt


This content originally appeared on DEV Community and was authored by Matt Ruiz


Print Share Comment Cite Upload Translate Updates
APA

Matt Ruiz | Sciencx (2025-01-21T14:48:47+00:00) [!] CocoaPods could not find compatible versions for pod. Retrieved from https://www.scien.cx/2025/01/21/cocoapods-could-not-find-compatible-versions-for-pod/

MLA
" » [!] CocoaPods could not find compatible versions for pod." Matt Ruiz | Sciencx - Tuesday January 21, 2025, https://www.scien.cx/2025/01/21/cocoapods-could-not-find-compatible-versions-for-pod/
HARVARD
Matt Ruiz | Sciencx Tuesday January 21, 2025 » [!] CocoaPods could not find compatible versions for pod., viewed ,<https://www.scien.cx/2025/01/21/cocoapods-could-not-find-compatible-versions-for-pod/>
VANCOUVER
Matt Ruiz | Sciencx - » [!] CocoaPods could not find compatible versions for pod. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/01/21/cocoapods-could-not-find-compatible-versions-for-pod/
CHICAGO
" » [!] CocoaPods could not find compatible versions for pod." Matt Ruiz | Sciencx - Accessed . https://www.scien.cx/2025/01/21/cocoapods-could-not-find-compatible-versions-for-pod/
IEEE
" » [!] CocoaPods could not find compatible versions for pod." Matt Ruiz | Sciencx [Online]. Available: https://www.scien.cx/2025/01/21/cocoapods-could-not-find-compatible-versions-for-pod/. [Accessed: ]
rf:citation
» [!] CocoaPods could not find compatible versions for pod | Matt Ruiz | Sciencx | https://www.scien.cx/2025/01/21/cocoapods-could-not-find-compatible-versions-for-pod/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.