Skip to content

Installing CocoaPods hangs for a very long time and then fails #1919

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
miraage opened this issue Apr 19, 2023 · 8 comments
Closed

Installing CocoaPods hangs for a very long time and then fails #1919

miraage opened this issue Apr 19, 2023 · 8 comments

Comments

@miraage
Copy link

miraage commented Apr 19, 2023

Hello. I thought I'm having a similar issue to #573 or #487, but apparently not.

I get the following error message (thought, I have ruby & cocoapods):

error warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.12.1/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

✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
    at createFromTemplate (/Users/miraage/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/commands/init/init.js:131:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.initialize [as func] (/Users/miraage/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/commands/init/init.js:184:3)
    at async Command.handleAction (/Users/miraage/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/index.js:106:9)
info Run CLI with --verbose flag for more details.

I can't provide react-native info output, as I don't have this binary installed. If I'm reading docs right, I should not have this binary globally, only locally inside an already initialized project.

Ruby was installed via RVM, cocoapods via sudo gem install of newly selected RVM ruby.
Node is installed via NVM, npm & yarn are installed via npm i -g
XCode -> preferences -> locations -> cli utils is selected and matches XCode version.

OS: macOS 13.3.1
CPU: (10) arm64 Apple M1 Pro

➜  ~ pod --version
1.12.1
➜  ~ ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin22]
➜  ~ node -v
v16.19.0
➜  ~ yarn -v
1.22.19
➜  ~ npm -v
9.6.4

Any suggestions where should I look to fix the issue? Please, let me know I should provide any further information.

@adamTrz
Copy link
Collaborator

adamTrz commented Apr 27, 2023

Hi @miraage sorry for late response.
You can try to run npx react-native info from inside your react native project.
Also, could you try to go to ios dir and maybe try to install cocoapods manually as described here?

cd ios
bundle install
bundle exec pod install

@szymonrybczak
Copy link
Collaborator

Hey @miraage, does the solution from @adamTrz worked?

@eerjuano
Copy link

npx react-native info

Ey, I have execute the command because I have the same issue and I don't know what to do, this is what returned:
info Fetching system and libraries information... System: OS: macOS 13.0 CPU: (8) arm64 Apple M2 Memory: 148.09 MB / 8.00 GB Shell: version: 5.8.1 path: /bin/zsh Binaries: Node: version: 18.16.1 path: /usr/local/bin/node Yarn: Not Found npm: version: 9.5.1 path: /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: version: 1.12.1 path: /usr/local/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 22.4 - iOS 16.4 - macOS 13.3 - tvOS 16.4 - watchOS 9.4 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: version: 14.3.1/14E300c path: /usr/bin/xcodebuild Languages: Java: Not Found Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.4 wanted: 0.72.4 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: Not found newArchEnabled: Not found

@eerjuano
Copy link

Then, when I run bundle exec pod install it returns the next error:
`Framework build type is static library
node:fs:1396
handleErrorFromBinding(ctx);
^

Error: EACCES: permission denied, mkdir '/Users/juangarcia/Paco4/node_modules/react-native/sdks/hermes'
at Object.mkdirSync (node:fs:1396:3)
at copyPodSpec (/Users/juangarcia/Paco4/node_modules/react-native/scripts/hermes/hermes-utils.js:169:8)
at main (/Users/juangarcia/Paco4/node_modules/react-native/scripts/hermes/prepare-hermes-for-build.js:28:5)
at Object.
(/Users/juangarcia/Paco4/node_modules/react-native/scripts/hermes/prepare-hermes-for-build.js:44:1)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/Users/juangarcia/Paco4/node_modules/react-native/sdks/hermes'
}

Node.js v18.16.1

[!] Invalid Podfile file: exit.

from /Users/juangarcia/Paco4/ios/Podfile:34

-------------------------------------------

use_react_native!(

:path => config[:reactNativePath],

-------------------------------------------`

@szymonrybczak
Copy link
Collaborator

Hey @eerjuano, could you please provide demo, where we can reproduce your error? 🙏 And please make sure that you have correct Podfile and react-native.config.js (if exsists).

@eerjuano
Copy link

Hey @szymonrybczak actualy I don't know how to reproduce a demo, but I think is there the problem, how can I create the correct Podfile and react-native.config.js, because reinstalling and updating it ins't enough .

@szymonrybczak
Copy link
Collaborator

@eerjuano on your place I'll start with debugging what causes that error, I would debug step by step react-native.config.js. Also please update React Native if you're running on not supported version, maybe that causes this problem?

@eerjuano
Copy link

@szymonrybczak Sorry for the delay to respond, I had solve the problems that I had, the main problem was how I was managing the dependencies with npm. Because in some cases like watchman, have to be installed with brew. So, thanks for the help, I appreciated to much.

@adamTrz adamTrz closed this as completed Aug 19, 2023
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

4 participants