skip to Main Content

I have created a react-native project having following dependencies:
"react": "18.2.0",
"react-native": "0.73.1",

Now I am trying Stripe Payment Integration in this project. For this I have installed the node package :
"@stripe/stripe-react-native": "^0.37.3",

But when I am trying to do "pod install" I am getting error :

[!] CocoaPods could not find compatible versions for pod "StripePayments": In Podfile: stripe-react-native (from ../node_modules/@stripe/stripe-react-native`) was resolved to 0.37.3, which depends on
StripePayments (~> 23.27.0)

None of your spec sources contain a spec satisfying the dependency: StripePayments (~> 23.27.0).

You have either:

out-of-date source repos which you can update with pod repo update or with pod install –repo-update.
mistyped the name or version.
not added the source repo that hosts the Podspec to your Podfile.`
System details =>
system : macOS Sonoma version 14.4.1
simulator : iPhone 15 Pro Max – iOS 17.2

cocoapods =>
gem which cocoapods
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods.rb

Any ideas??
Please assist me here..

I tried some solutions like :

But none of them worked for me.

PLEASE HELP ME INSTALL STRIPE SDK.

2

Answers


  1. Chosen as BEST ANSWER

    After multiple trials what helped me is to completely remove the cocoapods from my system and re-installed same.

    To check the versions of cocoapods installed :

    command: gem list --local | grep cocoapods

    output:

    cocoapods (1.15.2, 1.14.3)
    cocoapods-core (1.15.2, 1.14.3)
    cocoapods-deintegrate (1.0.5)
    cocoapods-downloader (2.1)
    cocoapods-plugins (1.0.0)
    cocoapods-search (1.0.1)
    cocoapods-trunk (1.6.0)
    cocoapods-try (1.2.0)
    

    Then to uninstall cocoapods completely, I individually removed each and every package like this

    Commands :

    sudo gem uninstall cocoapods
    sudo gem uninstall cocoapods-core
    sudo gem uninstall cocoapods-deintegrate
    sudo gem uninstall cocoapods-downloader
    sudo gem uninstall cocoapods-plugins
    sudo gem uninstall cocoapods-search
    sudo gem uninstall cocoapods-trunk
    sudo gem uninstall cocoapods-try
    

    Then I re-installed cocoapods with following command :

    sudo gem install cocoapods
    

    After that I installed the stripe npm package

    npm install @stripe/stripe-react-native
    

    and install the pod

    cd ios && pod install
    

    and finally stipe npm package installed successfully for iOS


  2. Go to the ios directory, delete Podfile.lock file and Pods/ directory and execute pod install --repo-update

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search