react-native: error: warn Multiple Podfiles were found when trying to init react-native project in mac os
Description
At first, when I tried to init a react-native project, “ruby version 2.5.7” error was shown.
I updated ruby successfully to the required version using the guide and rbenv
Now, when I am trying to create a new project I am getting multiple pod file errors.
Version
0.70.6
Output of npx react-native info
error warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
Steps to reproduce
I updated ruby successfully to the required version using the guide and benv
Snack, code example, screenshot, or link to a repository

About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 18
- Comments: 40 (11 by maintainers)
There is a section on the docs that suggests:
What happen to me is that I went there and I saw the version (only one in my case) and I assume it was selected already but you need to clicked and make sure it get selected by having a version under the select as the image below:
At least that worked for me. Also if you don’t know how to open this panel just press
CMD + ,✌️Running
gem uninstall cocoapodsandgem install cocoapodshelped me.Hi there!
The warning about multiple Podfile should not stop you from building the app. However, I put up a PR to fix this for new apps.
Probably, the problem is a misconfiguration of the environment. To make sure of it, could you try to manually install the pods by (from a Terminal):
cd iosbundle install(you need to run this only once)bundle exec pod installThis should give us a better diagnostic of your problem.Thank you so much.
I was able to solve this issue by performing the following steps:
If you are concerned about the
multiple podfilewarning:TLTR; In my case the issue was with Pod having old repo db, fixed with
pod repo updateand thenbundle exec pod install.I found out this after doing a manual pod install:
Hi @amypellegrini! Yes, you can create a new React Native app with
npx react-Native unit <AppName> --skip-install.This creates a new app from the React Native template, without installing any dependencies.
Which means that you have to run
yarn installmanually, but it will skip the iOS setup.@cipolleschi Thank for you reply, I realize that, and running the command does fix the issue. However I’m working off the following repo, https://github.com/thecodingmachine/react-native-boilerplate/issues/344 and trying to understand why this error occurs. There must be an incorrect version listed somewhere for cocopods or something 🤷♀️
Exact same issue