Skip to content
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

Error running pod install React Native #12260

Closed
Hranatikk opened this issue Feb 5, 2024 · 1 comment
Closed

Error running pod install React Native #12260

Hranatikk opened this issue Feb 5, 2024 · 1 comment

Comments

@Hranatikk
Copy link

Hranatikk commented Feb 5, 2024

Command

/opt/homebrew/Cellar/cocoapods/1.15.0/libexec/bin/pod install --allow-root

Report

  • Try to install pods

  • Pods to be installed

  • Error while installing hermes

Stack

   CocoaPods : 1.15.0
        Ruby : ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
    RubyGems : 3.5.4
        Host : macOS 14.1 (23B2073)
       Xcode : 15.2 (15C500b)
         Git : git version 2.39.3 (Apple Git-145)
Ruby lib dir : /opt/homebrew/Cellar/ruby/3.3.0/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")

require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}

ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']

platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
install! 'cocoapods',
  :deterministic_uuids => false

prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,
# you can also exclude `react-native-flipper` in `react-native.config.js`
#
# ```js
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
#   }
# }
# ```
flipper_config = FlipperConfiguration.disabled
if ENV['NO_FLIPPER'] == '1' then
  # Explicitly disabled through environment variables
  flipper_config = FlipperConfiguration.disabled
elsif podfile_properties.key?('ios.flipper') then
  # Configure Flipper in Podfile.properties.json
  if podfile_properties['ios.flipper'] == 'true' then
    flipper_config = FlipperConfiguration.enabled(["Debug", "Release"])
  elsif podfile_properties['ios.flipper'] != 'false' then
    flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] })
  end
end

target 'AwesomeApp' do
  use_expo_modules!
  config = use_native_modules!

  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']

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

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    # Note that if you have use_frameworks! enabled, Flipper will not work if enabled
    :flipper_configuration => flipper_config
  )

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)

    # This is necessary for Xcode 14, because it signs resource bundles by default
    # when building for devices.
    installer.target_installation_results.pod_target_installation_results
      .each do |pod_name, target_installation_result|
      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
        resource_bundle_target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
    end
  end

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
end

Error

Errno::EEXIST - File exists @ syserr_fail2_in - /Users/hranatikk/Library/Caches/CocoaPods/Pods/External/hermes-engine/297ebba3ddadb20a86a625cc0bfe59ba-9180d/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/Resources
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2254:in `symlink'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2254:in `copy'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:1048:in `block in copy_entry'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2385:in `wrap_traverse'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2388:in `block in wrap_traverse'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2387:in `each'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2387:in `wrap_traverse'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:1045:in `copy_entry'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:990:in `block in cp_r'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2469:in `block in fu_each_src_dest'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2478:in `block in fu_each_src_dest0'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2476:in `each'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2476:in `fu_each_src_dest0'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:2467:in `fu_each_src_dest'
/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/fileutils.rb:989:in `cp_r'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:343:in `block (2 levels) in copy_files'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:341:in `each'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:341:in `block in copy_files'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:128:in `lock'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:99:in `write_lock'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:332:in `copy_files'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:269:in `block (2 levels) in uncached_pod'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:265:in `each'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:265:in `block in uncached_pod'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:291:in `in_tmpdir'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:238:in `uncached_pod'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader.rb:42:in `download'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer/pod_source_downloader.rb:69:in `download!'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer/pod_source_installer.rb:117:in `download_source'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer/pod_source_installer.rb:67:in `install!'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:621:in `install_source_of_pod'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:539:in `block (2 levels) in install_pod_sources'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/user_interface.rb:86:in `titled_section'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:538:in `block in install_pod_sources'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:535:in `each'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:535:in `install_pod_sources'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:258:in `block in download_dependencies'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:257:in `download_dependencies'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:163:in `install!'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.0/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.15.0/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.15.0/libexec/bin/pod:25:in `<main>'

Already try this solution, didn't work

If I run pod install without sudo and --allow-root, it just show error

[!] Invalid `Podfile` file: exit.

 #  from /Users/hranatikk/Documents/awesome-app/ios/Podfile:50
 #  -------------------------------------------
 #  
 >    use_react_native!(
 #      :path => config[:reactNativePath],
 #  -------------------------------------------

Also tried to uninstall cocoapods from brew and install with gem, also didn't work

@paulb777
Copy link
Member

paulb777 commented Feb 5, 2024

Dupe of #12226

@paulb777 paulb777 closed this as completed Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants