react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Couldn't run pod install (no implicit conversion of Hash into String)

Open iamvucms opened this issue 2 years ago • 8 comments

Description

I just bring a project from window to macos and facing this bug when running pod install

Setting REACT_NATIVE build settings
[!] An error occurred while processing the post-install hook of the Podfile.

no implicit conversion of Hash into String

/Users/user/Desktop/Projects/x-gram/node_modules/react-native/scripts/react_native_pods.rb:292:in `join'

Version

0.69.3

Output of npx react-native info

System: OS: macOS 12.6 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 132.85 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.7.0 - ~/.nvm/versions/node/v18.7.0/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.15.0 - ~/.nvm/versions/node/v18.7.0/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.3 - /Users/hiko/.rvm/gems/ruby-2.7.5/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.3 => 0.69.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Init new react native project and run pod install

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

image

iamvucms avatar Oct 14 '22 02:10 iamvucms

Can you share your ios/Podfile file? Do you have any customization there? It seems like your project is failing here:

https://github.com/facebook/react-native/blob/3e75c0b3baa265a7b5431cd2d304389f9a3faa44/scripts/react_native_pods.rb#L292

So I'm wondering if you edited the react_native_path in any form

cortinico avatar Oct 14 '22 19:10 cortinico

Hi @cortinico, Here is my podfile, I didn't change anything yet. I init project on my window, then bring it to macos but face this issue.

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

target 'XGram' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    # Upcoming versions of React Native may rely on get_default_flags(), but
    # we make it explicit here to aid in the React Native upgrade process.
    :hermes_enabled => true,
    :fabric_enabled => flags[:fabric_enabled],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    :flipper_configuration => FlipperConfiguration.enabled,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'XGramTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

iamvucms avatar Oct 15 '22 06:10 iamvucms

Did you run yarn or npm install?

francisseverino avatar Oct 17 '22 03:10 francisseverino

0.69.3

Could you try on 0.70.3?

cortinico avatar Oct 17 '22 11:10 cortinico

Same error for me.

sleaper avatar Oct 17 '22 19:10 sleaper

I removed post_install and it works for now.

sleaper avatar Oct 17 '22 19:10 sleaper

I removed post_install and it works for now.

I did it and could run pod install but faced some errors such as couldn't control statusbar in ios, it required uiviewcontrollerbasedstatusbarappearance in info.plist to YES. It related to skipping above step I think.

iamvucms avatar Oct 19 '22 13:10 iamvucms

Commented out mac_catalyst_enabled => true and everything worked fine. Thanks all

post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      # :mac_catalyst_enabled => true <----- comment this line
    )
    # __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

iamvucms avatar Oct 27 '22 05:10 iamvucms

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 25 '23 06:04 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar May 12 '23 12:05 github-actions[bot]

by commenting this # react_native_post_install( # installer, # config[:reactNativePath], # :mac_catalyst_enabled => false, # # :ccache_enabled => true # ) I successfully installed the pods but was not able to run the project.

"react-native": "0.74.1", "@react-native-firebase/app": "^19.2.2", "@react-native-firebase/messaging": "^19.2.2",

arslanafzal077 avatar May 03 '24 11:05 arslanafzal077