Skip to content

Installing CocoaPods takes a long time with no status indicator #573

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

Closed
elicwhite opened this issue Jul 22, 2019 · 14 comments
Closed

Installing CocoaPods takes a long time with no status indicator #573

elicwhite opened this issue Jul 22, 2019 · 14 comments
Labels
bug Something isn't working command: init

Comments

@elicwhite
Copy link
Contributor

Environment

System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
    Memory: 1.02 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
    Yarn: 1.7.0 - ~/.yarn/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
    Watchman: 4.9.4 - /opt/facebook/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 23, 24, 25, 26, 27, 28
      Build Tools: 23.0.1, 25.0.0, 25.0.2, 27.0.3, 28.0.2, 28.0.3, 29.0.0
      System Images: android-24 | Intel x86 Atom, android-24 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom
      Android NDK: 15.2.4203891
  IDEs:
    Android Studio: 3.3 AI-182.5107.16.33.5314842
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.4 => 0.60.4

Description

When init'ing a new project, I got a prompt that CocoaPods is not installed. I entered my password and gave it permission to install. The installation took a long time but there was no progress indicator so it wasn't clear if it hung or not. All I know is that my CPU usage was high.

...
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
✨  Done in 7.56s.
info Installing required CocoaPods dependencies
? CocoaPods (https://cocoapods.org/) is not installed. It's necessary for iOS project to run correctly. Do you want to install it? Yes
Password:

A progress indicator, or even passing through stdout during this process would be helpful to know that the process hasn't hung.

Reproducible Demo

On a machine with cocoapods not installed, run npx react-native init cocoapodstest and give permission to install cocoapods.

@elicwhite elicwhite added the bug Something isn't working label Jul 22, 2019
@elicwhite
Copy link
Contributor Author

Ah, this actually looks like it should have been solved by #487

I just created this project so I imagine I would have been on 2.7.1. I'll check again when I get back to my computer.

@elicwhite
Copy link
Contributor Author

Yep, still repros on 2.7.1

$ yarn why @react-native-community/cli
yarn why v1.7.0
warning ../package.json: No license field
[1/4] 🤔  Why do we have the module "@react-native-community/cli"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "@react-native-community/[email protected]"
info Reasons this module exists
   - "react-native" depends on it
   - Hoisted from "react-native#@react-native-community#cli"
info Disk size without dependencies: "1.17MB"
info Disk size with unique dependencies: "15.12MB"
info Disk size with transitive dependencies: "105.59MB"
info Number of shared dependencies: 223
✨  Done in 1.32s.

@thymikee
Copy link
Member

Maybe it really makes sense to pass stdout here. We'll investigate what can be done

@simka
Copy link
Contributor

simka commented Aug 8, 2019

@TheSavior during the init, have you seen other loading indicators and only the CocoaPods installation step didn't have any?

I tried to reproduce it and this is how it looks in my case: https://asciinema.org/a/SjZyniwPvWKoWSc12Fijqt8dP

@ghost
Copy link

ghost commented Sep 1, 2019

still have problems.. on macOS Mojave

sudo gem install cocoapods

[!] You cannot run CocoaPods as root.

info Installing required CocoaPods dependencies
? CocoaPods (https://cocoapods.org/) is not installed. It's necessary for iOS project to run correctly. Do you want to install it? Yes
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)

Usage:

    $ pod COMMAND

      CocoaPods, the Cocoa library package manager.

Commands:

    + cache      Manipulate the CocoaPods cache
    + env        Display pod environment
    + init       Generate a Podfile for the current directory
    + install    Install project dependencies according to versions from a
                 Podfile.lock
    + ipc        Inter-process communication
    + lib        Develop pods
    + list       List pods
    + outdated   Show outdated project dependencies
    + repo       Manage spec-repositories
    + setup      Setup the CocoaPods environment
    + spec       Manage pod specs
    + update     Update outdated project dependencies and create new Podfile.lock

Options:

    --silent     Show nothing
    --version    Show the version of the tool
    --verbose    Show more debugging information
    --no-ansi    Show output without ANSI codes
    --help       Show help banner of specified command
	from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:47:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.5/bin/pod:55:in `<top (required)>'
	from /usr/local/bin/pod:22:in `load'
	from /usr/local/bin/pod:22:in `<main>'

(node:621) UnhandledPromiseRejectionWarning: Error: Failed to update CocoaPods repositories for iOS project.
Please try again manually: "pod repo update".
CocoaPods documentation: https://cocoapods.org/
    at updatePods (/Users/brody/Desktop/AwesomeProject/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/installPods.js:81:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:621) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:621) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@ghost
Copy link

ghost commented Sep 1, 2019

you must install yarn

brew install yarn

@alloy
Copy link
Member

alloy commented Sep 2, 2019

@TheSavior @thymikee I assume this is because it’s cloning the specs repo. In v1.7 a CDN version of this was added, which only fetches the specs you need during dependency resolution and is thus much faster, however only in v1.8 will it become the default. I.e. I wouldn’t spend a lot of time on this just yet.

@thymikee
Copy link
Member

thymikee commented Mar 9, 2020

Closing, as CocoaPods 1.8+ is already present for a few months now, resulting in faster installs.

@gidex19
Copy link

gidex19 commented Aug 10, 2023

On my mac os Big Sur...sudo gem install cocoapods just stays static without any output ..

@james-mann
Copy link

sudo gem install cocoapods -V would be helpful

@MikkyBoy357
Copy link

run sudo gem install cocoapods --verbose to see download progress logs

@shirakaba
Copy link

I found that the Expo CLI gets stuck on the same step. If I pass EXPO_DEBUG=1, I can get verbose logs:

EXPO_DEBUG=1 npx expo prebuild --clean

I found that this is the last log message it emits before it gets stuck:

[Hermes] Using release tarball from URL: https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.77.0/react-native-artifacts-0.77.0-hermes-ios-debug.tar.gz

# It can get stuck on this message for 20+ minutes.
# Having downloaded it in another project previously doesn't seem to cache it.

Downloading dependencies

Strangely, if I kill the process and do an independent cd ios && pod install, it gets past that step fairly quickly, with better progress updates as well.

Not sure what it is about downloading that file in a wrapper CLI that makes it take over 20 minutes.

@edycarreyes99
Copy link

On my mac os Big Sur...sudo gem install cocoapods just stays static without any output ..

same in my MacBook Pro M4 Pro with Sequoia 15.3

@vipulbhj
Copy link

vipulbhj commented Feb 14, 2025

On my mac os Big Sur...sudo gem install cocoapods just stays static without any output ..

same in my MacBook Pro M4 Pro with Sequoia 15.3

+1, same configuration, same issue

Seems like an ISP issue, connecting to VPN helped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working command: init
Projects
None yet
Development

No branches or pull requests

10 participants