expo: `pod install` fails with `use_expo_modules!`
Summary
I’ve created a new expo app by doing npx create-expo-app test-app
Then in the app, I did expo run:ios to launch iOS simulator. Yet, it fails with pod install, erroring with the following message.
expo run:ios
⚠️ Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file: undefined method `exists?' for File:Class.
# from /Users/andrew/deepeyes/test-app/ios/Podfile:13
# -------------------------------------------
# target 'testapp' do
> use_expo_modules!
# config = use_native_modules!
# -------------------------------------------
What platform(s) does this occur on?
iOS
SDK Version
47.0.11
Environment
expo-env-info 1.0.5 environment info: System: OS: macOS 13.0 Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm Watchman: 2023.01.02.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.10.2 - /Users/andrew/.rubies/ruby-3.2.0/bin/pod IDEs: Xcode: /undefined - /usr/bin/xcodebuild npmPackages: expo: ~47.0.9 => 47.0.11 react: 18.1.0 => 18.1.0 react-native: 0.70.5 => 0.70.5 Expo Workflow: bare
Minimal reproducible example
- Create a new app:
npx create-expo-app test-app - Run the command:
expo run:ios
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 4
- Comments: 34 (7 by maintainers)
I had another issue with ruby installed with
brew. My workaround was to install ruby withchrubyandruby-install. ruby 3.1.3 is the version without XCode 14 issue.Then you have to update your
~/.zshrcwith the following.Then install cocoapods. I didn’t have to use
sudoIt finally worked for me.
@brentvatne
please re-open this, this is a major issue and needs to be addressed ASAP.
Got the same issue
All new builds on IOS are currently broken.
exists?functionIt’s currently impossible for any new people to setup a new react native ios project.
@brentvatne Please reopen the issue.
That worked:
Or more simply, for current shell only:
Thank you! It works. You are Genius!
As a hint for someone who is not familiar (as I was as a new mac user) and using default homerew and shell settings:
you likely have an old version of cocoapods installed. version 1.10.0 or later is required
Here is the work around if don’t have time to wait on a fix
brew install ruby@3.1gem install cocoapodsgem envfind the EXECUTABLE_DIRECTORY for the gem env@darrylyoung I asked the gesture handler team to release that fix, they might be able to release it today 😉
I’ve just published a fix in
expo@47.0.13. Let me know if that works for you 😉 And thank you @KiwiKilian for submitting a PR for this 🙏Need to remove ruby and cocoapods before running this: brew uninstall ruby cocoapods
And then this was working
Here is the diff if someone wants to PR this
In my case, I am using homebrew ruby & cocoapods. However, the latest version is updated to “3.2”. The version removed deprecated ‘exist’ method. So, I changed default ruby (2.6) & cocoapods with gem. This resolved the issue.
Similar issue: https://www.linuxquestions.org/questions/slackware-14/error-in-compilation-of-mkvtoolnix-73-0-0-a-4175720454/
I mangeded to fix it by installing cocoapods via
gem install cocoapods --user-installinstead of homebrew@dsincariuc have you seen my comment here https://github.com/expo/expo/issues/20707#issuecomment-1377916529 ? You need
expopackage to be at least47.0.13.None of the solutions above worked for me. I don’t use expo but having the same issue on m1 chip.
It’s now working for me, but only when I manually do the proposed change in this
react-native-gesture-handlerPR. I know that’s an issue with the other package, though. From an Expo point of view, it seems like it’s solved. Thank you, @tsapeta!For context, this is the issue I’m still getting on
47.0.13until I make the other change:Also, I’m using the standard macOS Ruby install:
@tsapeta I just switched from
47.0.12to47.0.13and it indeed fixed this issue for meps: arm64 M1 / macOs Ventura 13.1
same here
This issue should be re-opened: Attemping to build a fresh expo project fails under ruby 3.2.
This seems to be because
File.exists?was removed in Ruby 3.2. Here is the same issue rearing its head on a different/similar product: https://github.com/flutter/flutter/issues/109385