Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new project is stuck at Installing cocoapods dependencies #35819

Closed
BraveEvidence opened this issue Jan 13, 2023 · 10 comments
Closed

Comments

@BraveEvidence
Copy link

Description

I have all the necessary dependencies like Xcode, home-brew, cocoapods etc installed on my device. I am able to work with previous of react native as well. For react native 0.71 when I try to create a new project it is stuck on Installing cocoapods dependencies

Version

0.71

Output of npx react-native info

error Unrecognized command "info".
info Run "react-native --help" to see a list of all available commands.

Steps to reproduce

Create a new project using npx react-native init MyApp

Snack, code example, screenshot, or link to a repository

Screenshot 2023-01-13 at 1 48 30 PM

@bbredewold
Copy link

What do you mean stuck? This step could take a very long time!

@BraveEvidence
Copy link
Author

I am waiting for more than an hour. If it takes this long for a bare bones project then something might be wrong

@vincicat
Copy link

vincicat commented Jan 13, 2023

I got an error instead: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template. Please try again manually

so your pod install may be failed but the installer doesn't know it for some reason

After I run the pod install manually I found out that is one of the podspec failed like this issue #35818

Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[!] Failed to load 'hermes-engine' podspec: 
[!] Invalid `hermes-engine.podspec` file: undefined method `exists?' for File:Class.
 #  from [..]/node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec:46
 #  -------------------------------------------
 #    source[:http] = "file://#{destination_path}"
 >  elsif File.exists?(hermestag_file) && isInCI
 #    Pod::UI.puts '[Hermes] Detected that you are on a React Native release branch, building Hermes from source but fetched from tag...'.yellow if Object.const_defined?("Pod::UI")
 #  -------------------------------------------

...so this is the hermes-engine podspec using deprecated ruby function. Check your pod environment pod env to see if your cocoapods is using ruby 3.2:

CocoaPods : 1.11.3
Ruby : ruby 3.2.0 (2022-12-25 revision a528908271)

solution: a. downgrade your ruby (use rvm or see comment in #35818) or b. patch the podspec in node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec like software-mansion/react-native-gesture-handler#2368

@BraveEvidence
Copy link
Author

@vincicat How long did you wait to get this error? I waited an hour and ran out of patience and gave up on it

@BraveEvidence
Copy link
Author

I tried it again and it is resolved

@insanebear
Copy link

insanebear commented Jan 30, 2023

This issue has been closed, but hopefully it might help someone experiencing this problem.
I had the same problem and found one workaround

You can download tar.gz from Chrome and then let the command know the location first with installation command.

Anyhow this step took a lot of time. In my case, more than a half hour.
You can check the progress using --verbose.

@hpelitebook745G2
Copy link

hpelitebook745G2 commented Feb 6, 2023

@insanebear i understand that you have to download the tarball first. however, the link you provided didn't mention the source he got it from. i can't find hermes-runtime-darwin-v0.70.0.tar.gz here (https://github.com/facebook/hermes/releases) either.

any idea?

@insanebear
Copy link

@hpelitebook745G2 Yeah, I forgot to mention it. I was also struggling to find the file. Since the time passed by, it is little vague for me to reccall now, but I tried a url link that was printed in the console with verbose mode on a browser and it asked me where to download. Trying installing CocoaPods with --verbose and check if there is the url.

@cortinico
Copy link
Contributor

cortinico commented Feb 8, 2023

You can download tar.gz from Chrome and then let the command know the location first with installation command.

This is not the solution, it's just a workaround.

@insanebear i understand that you have to download the tarball first. however, the link you provided didn't mention the source he got it from. i can't find hermes-runtime-darwin-v0.70.0.tar.gz here (facebook/hermes/releases) either.

We moved Hermes artifacts to Maven Central so you won't find them in the Hermes repo itself.
Please open a separate issue, share your log, and we can try to fix this rather than suggesting manual workarounds

@insanebear
Copy link

@cortinico You have a point. My bad. It should be mentioned as a workaround. English is not my primary language and I missed it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants