question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pod install fails on RN 0.67.2 on M1 Mac

See original GitHub issue

Description

Pod install fails and crashes when run on an m1 mac.

Error log:

Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
/opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in `initialize': undefined method `with_indifferent_access' for "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0,maximum-scale=1.0\\" /><style>body{margin:0px;padding:0px;}iframe{width:100%;height:100%}</style><iframe src=\\"http://www.airtel.in/dot/\\" width=\\"100%\\" height=\\"100%\\" frameborder=0></iframe>":String (NoMethodError)

        hash = hash.with_indifferent_access
                   ^^^^^^^^^^^^^^^^^^^^^^^^
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `new'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `from_file'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in `refresh_metadata'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in `refresh_metadata'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `new'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:173:in `repo_information'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:77:in `stack'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:24:in `report'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
	from /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25:in `load'
	from /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25:in `<main>'
/opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:15:in `initialize': undefined method `with_indifferent_access' for "<meta name=\\"viewport\\" content=\\"width=device-width,initial-scale=1.0,maximum-scale=1.0\\" /><style>body{margin:0px;padding:0px;}iframe{width:100%;height:100%}</style><iframe src=\\"http://www.airtel.in/dot/\\" width=\\"100%\\" height=\\"100%\\" frameborder=0></iframe>":String (NoMethodError)

        hash = hash.with_indifferent_access
                   ^^^^^^^^^^^^^^^^^^^^^^^^
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `new'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/metadata.rb:28:in `from_file'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:441:in `refresh_metadata'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:56:in `refresh_metadata'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30:in `initialize'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `new'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:60:in `all'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:393:in `source_with_url'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/sources_manager.rb:22:in `find_or_create_source_with_url'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `map'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:177:in `sources'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1077:in `block in resolve_dependencies'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
	from /opt/homebrew/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
	from /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25:in `load'
	from /opt/homebrew/Cellar/cocoapods/1.11.2_2/libexec/bin/pod:25:in `<main>'

Version

0.67.2

Output of npx react-native info

System: OS: macOS 12.2 CPU: (8) arm64 Apple M1 Memory: 95.78 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.4.0 - /opt/homebrew/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.3.1 - /opt/homebrew/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8139111 Xcode: 13.3/13E5086k - /usr/bin/xcodebuild Languages: Java: 11.0.14 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.2 => 0.67.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  1. Create a new project on an M1 mac.
  2. cd ios and run pod install.

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

https://github.com/Abhishek12345679/AwesomeTSProject

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Abhishek12345679commented, Feb 14, 2022

It finally worked. The issue was with expo sdk 44 since i was using expo-modules in my project. Check this thread out for the fix: https://github.com/expo/expo/issues/15622

Particularly, this comment

1reaction
cortinicocommented, Feb 10, 2022

Is this happening on a fresh project? If so, this sounds like a problem, but it’s curious that no one reported it before 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix “pod install” error in React Native on Mac M1
Install the ffi Ruby gem (which dynamically links native libraries programmatically) using Apple's Rosetta 2: sudo arch -x86_64 gem install ffi .
Read more >
Pod install fails on m1 macbook - Stack Overflow
In Xcode Preferences > Location , my Command Line Tools setting was empty. I clicked the dropdown and set it accordingly. · I...
Read more >
m1 command phasescriptexecution failed with a nonzero exit ...
One possible reason could be that Xcode is using an outdated version of Node (in my case, it was because I use nvm...
Read more >
How to fix “pod install” error in React Native on Mac M1 - Reddit
Hi, anybody else having building issues with React Native on the newest MacBook Pros equipped with the Apple M1 Pro CPU?
Read more >
Troubleshooting - React Native
CocoaPods and Node Reset​ · Run pod deintegrate in your ios directory (or wherever your Podfile is located) and re-run pod install (or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found