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 onStripePayments (~> 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 :
- https://stackoverflow.com/a/67803629/1619329
- https://github.com/stripe/stripe-react-native/issues/1116#issuecomment-1312067936
But none of them worked for me.
PLEASE HELP ME INSTALL STRIPE SDK.
2
Answers
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:
Then to uninstall cocoapods completely, I individually removed each and every package like this
Commands :
Then I re-installed cocoapods with following command :
After that I installed the stripe npm package
and install the pod
and finally stipe npm package installed successfully for iOS
Go to the
ios
directory, deletePodfile.lock
file andPods/
directory and executepod install --repo-update