I'm working on a React Native iOS project using React Native 0.81.4, and I'm getting a CocoaPods–related error when running:
Installing Ruby Gems
Installing CocoaPods dependencies with New Architecture
error The version of CocoaPods used to generate the lockfile (1.16.2) is higher than the version of the current executable (1.15.2). Incompatibility issues may arise.
error Something went wrong while installing CocoaPods. Please run pod install manually.
Screenshot of the full error:
(Uploaded screenshot)
Error message: CocoaPods 1.16.2 lockfile vs 1.15.2 executable
It seems like the Podfile.lock was generated using CocoaPods 1.16.2, but my system is using 1.15.2.
I'm not sure whether I should upgrade CocoaPods globally, downgrade the lockfile, or reinstall pods.
What I’ve tried
- Running pod install manually → same warning/error.
- Running sudo gem install cocoapods (but my machine uses RVM and warns about Ruby interpreter mismatches).
- Cleaning the iOS build folder.
- reinstall node_modules
- update ruby, cocoapods, gems, bundler
Questions
(1) Should I upgrade CocoaPods to 1.16.2 (and if yes, what's the correct method when using RVM)?
(2) Is there a safe way to regenerate the Podfile.lock for 1.15.2 instead?
(3) Is this related to React Native 0.81.4’s New Architecture setup?
Any guidance on the correct fix would be appreciated!
pod installagain.