react-native: pod install fails on RN 0.67.2 on M1 Mac

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

About this issue

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

Most upvoted comments

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

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