# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
def share_pods (target_name)
# 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,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target target_name do
$config = use_native_modules!
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
use_react_native!(
:path => $config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# :flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
end
end
share_pods('target1')
share_pods('target1-prod')
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
$config[:reactNativePath],
:mac_catalyst_enabled => false
)
end
Если я удалю act_native_post_install, все будет работать нормально, но это не правильное решение
Я обновил React Native с версии 0.72 до 0.73.8, но когда я пытаюсь установить модули с помощью pod install, я получаю следующую ошибку: [code]Downloading dependencies Generating Pods project Setting USE_HERMES build settings Setting REACT_NATIVE build settings [!] An error occurred while processing the post-install hook of the Podfile.
no implicit conversion of nil into String
/Users/francescoclementi/Documents/develop/parkinglesscustomer/node_modules/react-native/scripts/cocoapods/utils.rb:130:in `join' /Users/francescoclementi/Documents/develop/parkinglesscustomer/node_modules/react-native/scripts/cocoapods/utils.rb:130:in `block (2 levels) in set_node_modules_user_settings' /Users/francescoclementi/Documents/develop/parkinglesscustomer/node_modules/react-native/scripts/cocoapods/utils.rb:129:in `each' /Users/francescoclementi/Documents/develop/parkinglesscustomer/node_modules/react-native/scripts/cocoapods/utils.rb:129:in `block in set_node_modules_user_settings' /Users/francescoclementi/Documents/develop/parkinglesscustomer/node_modules/react-native/scripts/cocoapods/utils.rb:128:in `each' /Users/francescoclementi/Documents/develop/parkinglesscustomer/node_modules/react-native/scripts/cocoapods/utils.rb:128:in `set_node_modules_user_settings' /Users/francescoclementi/Documents/develop/parkinglesscustomer/node_modules/react-native/scripts/react_native_pods.rb:307:in `react_native_post_install' /Users/francescoclementi/Documents/develop/parkinglesscustomer/ios/Podfile:55:in `block (2 levels) in from_ruby' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-core-1.15.2/lib/cocoapods-core/podfile.rb:196:in `post_install!' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1013:in `run_podfile_post_install_hook' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1001:in `block in run_podfile_post_install_hooks' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:149:in `message' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1000:in `run_podfile_post_install_hooks' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:337:in `block (2 levels) in create_and_save_projects' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:336:in `block in create_and_save_projects' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in `section' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:315:in `create_and_save_projects' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:307:in `generate_pods_project' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:183:in `integrate' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in `install!' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in `run' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run' /Users/francescoclementi/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0/gems/cocoapods-1.15.2/bin/pod:55:in `' /Users/francescoclementi/.rbenv/versions/2.7.4/bin/pod:23:in `load' /Users/francescoclementi/.rbenv/versions/2.7.4/bin/pod:23:in `' [/code] Это мой файл pod: [code]# Resolve react_native_pods.rb with node to allow for hoisting require Pod::Executable.execute_command('node', ['-p', 'require.resolve( "react-native/scripts/react_native_pods.rb", {paths: [process.argv[1]]}, )', __dir__]).strip
def share_pods (target_name) # 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,...) that will be excluded # # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` # ```js # module.exports = { # dependencies: { # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), # ``` flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS'] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end
use_react_native!( :path => $config[:reactNativePath], # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. # :flipper_configuration => flipper_config, # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) end end
share_pods('target1') share_pods('target1-prod')
post_install do |installer| # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 react_native_post_install( installer, $config[:reactNativePath], :mac_catalyst_enabled => false ) end [/code] Если я удалю act_native_post_install, все будет работать нормально, но это не правильное решение