Engr.Aftab Ufaq
Engr.Aftab Ufaq

Reputation: 6464

ld: library 'React-hermes' not found

i have this issue when i add firebase to react native project

ld: warning: ignoring duplicate libraries: '-lc++'
ld: warning: search path '/Users/apple/Library/Developer/Xcode/DerivedData/NurseProAI-ehqpcwuzmydaabbrpgleihpqaitv/Build/Products/Debug-iphonesimulator/React-Codegen' not found
ld: library 'React-hermes' not found
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

my podfile

# Resolve react_native_pods.rb with node to allow for hoisting
def node_require(script)
   # Resolve script with node to allow for hoisting
   require Pod::Executable.execute_command('node', ['-p',
     "require.resolve(
       '#{script}',
       {paths: [process.argv[1]]},
     )", __dir__]).strip
end

# Use it to require both react-native's and this package's scripts:
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

platform :ios, '18.0' # Specify the minimum iOS version explicitly
prepare_react_native_project!
setup_permissions([
  'Microphone',
  'PhotoLibrary',
  'PhotoLibraryAddOnly',
  'Camera',
  'LocationWhenInUse',
  'LocationAlways',
])
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 'NurseProAI' do
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true
  config = use_native_modules! 
  
  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    :hermes_enabled => true # Ensure Hermes is enabled
  )

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

  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,
      # :ccache_enabled => true
    )

    # Ensure Hermes dSYM is generated for Hermes.framework
    ### installer.pods_project.targets.each do |target|
    #   target.build_configurations.each do |config|
    #     # Check and set the DEBUG_INFORMATION_FORMAT for Hermes dSYM generation
    #     if target.name == 'hermes-engine' && config.build_settings['DEBUG_INFORMATION_FORMAT'] == 'dwarf'
    #       config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf-with-dsym'
    #     end
    #   end
    ### end
  end
end

package.json

 "@react-native-firebase/app": "21.6.1",
    "@react-native-firebase/auth": "21.6.1",
    "@react-native-firebase/messaging": "21.6.1",
    "@react-native-picker/picker": "^2.8.1",
    "@react-native-voice/voice": "^3.2.4",
    "@react-navigation/bottom-tabs": "^6.6.1",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/native-stack": "^6.9.26",
    "@reduxjs/toolkit": "^2.2.5",
    "@types/react-native-vector-icons": "^6.4.18",
    "axios": "^1.7.2",
    "date-fns": "^4.1.0",
    "formik": "^2.4.6",
    "i18n-js": "^4.4.3",
    "lodash": "^4.17.21",
    "lucide-react-native": "^0.469.0",
    "react": "18.3.1",
    "react-native": "0.76.0",

Upvotes: 1

Views: 16

Answers (0)

Related Questions