react-native
react-native copied to clipboard
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
Exact same issue
There is a section on the docs that suggests:
Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
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 + ,
✌️
I have the same issue and just installed a clean react native
And my xcode shows exactly as @duranmla
System:
OS: macOS 13.0
CPU: (12) arm64 Apple M2 Pro
Memory: 466.11 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
Yarn: Not Found
npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
Watchman: 2023.01.30.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/tiagosa/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.18 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.2 => 0.71.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
I have the same issue
I was able to solve this issue by performing the following steps:
did anyone find a solution ?
I have the same issue and just installed a clean react native
And my xcode shows exactly as @duranmla
System: OS: macOS 13.0 CPU: (12) arm64 Apple M2 Pro Memory: 466.11 MB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node Yarn: Not Found npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm Watchman: 2023.01.30.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/tiagosa/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 11.0.18 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.2 => 0.71.2 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found
did you find a solution ?
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):
- navigate to your app folder
-
cd ios
-
bundle install
(you need to run this only once) -
bundle exec pod install
This should give us a better diagnostic of your problem.
Thank you so much.
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):
- navigate to your app folder
cd ios
bundle install
(you need to run this only once)bundle exec pod install
This should give us a better diagnostic of your problem.Thank you so much.
what to do when we get the error when trying to create a project not creating bulid?
You should try the step I explained above.
There is something not correctly configured in the environment, thus the init
command fails to install the pods.
By navigating into the ios
folder, you can install the pods manually running bundle install
(only once per project) and then bundle exec pod install
.
This should output a more explorative message to help you fix the environment. Once fixed - and I can support you in setting that up once we have the right error - future init
command will work!
Running gem uninstall cocoapods
and gem install cocoapods
helped me.

For me after doing pod repo update
it crashed with some strange error:
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html
[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.
zsh: abort pod repo update```
@artak-avanesian, this look like an incomplete stack trace. There is no error here at all. It just say that you may have encountered a bug in the Ruby interpreter but there is nothing more... Could you provide some more info?
just created a new file using npx react-native@latest init AwesomeProject
and encountered the same warning.
since I'm also using rbenv, and the AwesomeProject/.ruby-version
file is included, I deleted the AwesomeProject/vendor
folder.
project builds fine now without the warning.
If you are concerned about the multiple podfile
warning:
- We already fixed and it will be removed in the next version of RN
- It is just a warning: it won't prevent you from creating an app. If pod install is failing, the problem is somewhere else, not in the warning.
Thanks @cipolleschi for the explanation. trying to create my first react native app, and having to battle this was not a great first impression, but I will still give it a go (y)
I'm happy that you will try again! 😃
Please, feel free to post any issues and reach out for help. We are committed in trying to improve the experience as much as we can (e.g.: solving that warning, or - spoiler for the next releases - removing the requirement of a specific ruby-version) so all your reports are extremely valuable for us!
That sounds awesome. The whole thing was a bit of a nightmare with the ruby thing, but when I first got it up and running, it seems really nice. Currently making some exiting stuff, so stay tuned ;)
There is a section on the docs that suggests:
Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
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 + ,
✌️
This worked for me also
There is a section on the docs that suggests:
Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
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 + ,
✌️This worked for me also
also me too
There is a section on the docs that suggests:
Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
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 + ,
✌️This worked for me also
also me too
me too
4. bundle exec pod install
I did the following, and got the following error:
[!] CocoaPods could not find compatible versions for pod "hermes-engine":
In snapshot (Podfile.lock):
hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
In Podfile:
hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
It seems like you've changed the version of the dependency `hermes-engine` and it differs from the version stored in `Pods/Local Podspecs`.
You should run `pod update hermes-engine --no-repo-update` to apply changes made locally.
@mkabatek your hermes version is not aligned with the one downloaded by react native. The error message contains instructions on how to fix it:
pod update hermes-engine --no-repo-update
Try to run this command and see if it fixes the issue! :D
@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 🤷♀️
There is a section on the docs that suggests:
Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
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 + ,
✌️
this solution worked for me as well
@oneeb-asad this is properly setup in my environment in xcode and the problem persists.
@mkabatek If I understand correctly:
-
npx react-native init
fails due to incorrect hermes versions - when you run
pod update hermes-engine --no-repo-update
, you manage to update the pods successfully - You ca then open Xcode and build the project, right?
What happens if after step 2, you try to run yarn ios
from the project root, instead?
Also, which version of React Native are you using?
Is it possible to do the Android setup only? The tool assumes you need to setup both platforms, hence the issue with iOS. I know is not solving the issue, but would it be any way of skipping iOS altogether?
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 install
manually, but it will skip the iOS setup.
What is the solution?I also encountered this problem