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

'React/RCTBridgeDelegate.h' file not found

Open Jyotiraditya008 opened this issue 3 years ago • 8 comments

Description

So i've been trying to run my iOS react native application but it keeps on showing this error. Steps i've tried

  1. pod install in ios folder but it shows following message

Analyzing dependencies Downloading dependencies Generating Pods project Integrating client project Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

[!] The Podfile does not contain any dependencies.

  1. Also ' react ' is missing in schemes

Version

0.70.6

Output of npx react-native info

System: OS: macOS 12.6 CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz Memory: 24.21 GB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.7.0 - /usr/local/bin/node Yarn: Not Found npm: 8.15.0 - /usr/local/bin/npm Watchman: 2023.01.09.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/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.3 AI-213.7172.25.2113.9123335 Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild Languages: Java: 15.0.9 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: ^0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Trying to run iOS react native project.

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

can't share the code

Jyotiraditya008 avatar Jan 14 '23 07:01 Jyotiraditya008

:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

github-actions[bot] avatar Jan 16 '23 11:01 github-actions[bot]

Hi @Jyotiraditya008, to help you, we need more information. First of all, you should try to create a repro with minimal code to highlight the issue. I understand you can't share your code, but you can try to create a new app and add similar code pieces to reveal the problem.

Thank you so much.

cipolleschi avatar Jan 16 '23 11:01 cipolleschi

Hi @Jyotiraditya008, to help you, we need more information. First of all, you should try to create a repro with minimal code to highlight the issue. I understand you can't share your code, but you can try to create a new app and add similar code pieces to reveal the problem.

Thank you so much.

i tried creating a new app and then install pods in that... But then also the same issue occured that said " Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

[!] The Podfile does not contain any dependencies. " I'm stuck since last 2 weeks

Jyotiraditya008 avatar Jan 20 '23 12:01 Jyotiraditya008

Can you share your podfile, please?

cipolleschi avatar Jan 20 '23 14:01 cipolleschi

Can you share your podfile, please?

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'CampusDEMO' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  pod 'React', :path => '../node_modules/react-native', :subspecs => [
      #'Core',
      'CxxBridge',
      'DevSupport',
      'RCTText',
      'RCTNetwork',
      'RCTWebSocket',
      'RCTAnimation',
      'RCTActionSheet',
      'RCTGeolocation',
      'RCTImage',
      'RCTLinkingIOS',
      'RCTSettings',
      'RCTText',
      'RCTVibration',
      'RCTBlob',
      'RCTCameraRoll',
      'RCTFileSystem',
      'RCTNetwork',
      'RCTWebSocket',
      'RCTAsyncStorage',

      
    ]
  # Pods for CampusDEMO

  target 'CampusDEMOTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Jyotiraditya008 avatar Jan 31 '23 05:01 Jyotiraditya008

I think that you are missing quite a bunch of stuff.

The Podfile should look more like this.

I strongly suggest you to use the use_react_native! function (as shown here) that takes care of installing the dependency properly.

cipolleschi avatar Jan 31 '23 12:01 cipolleschi

@cipolleschi those links now 404. Anywhere else I can find what your were linking to?

KHVol avatar Jul 07 '23 17:07 KHVol

The link got broken after the Monorepo refactoring landed. I just updated them!

cipolleschi avatar Jul 07 '23 19:07 cipolleschi

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 Jan 04 '24 05:01 github-actions[bot]

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

github-actions[bot] avatar Jan 11 '24 05:01 github-actions[bot]

Same problem here react native 0.72

config podfile

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


require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, '14.2' ##min_ios_version_supported
prepare_react_native_project!

use_frameworks! :linkage => :static


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 'mobile' do
  config = use_native_modules!
  
  pod 'React-Codegen', :path => 'build/generated/ios'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAppDelegate', :path => '../node_modules/react-native/Libraries/AppDelegate'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core', :path => '../node_modules/react-native/'


  #APP DETAILS
  pod 'OneSignalXCFramework', '3.12.9'
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'Firebase'
  $RNFirebaseAnalyticsWithoutAdIdSupport = true
  pod 'RNIap', :path => '../node_modules/react-native-iap'

  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
  pod 'RNCMaskedView', :path => '../node_modules/@react-native-community/masked-view'
  pod 'FBSDKLoginKit', '~> 9.3'
  pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
  pod 'FirebaseAnalytics'
  pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'



 
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
   
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'mobileTests' 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
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end


target 'OneSignalNotificationService' do
  pod 'OneSignal', '>= 3.0.0'
end

Feeeliperesende avatar May 27 '24 00:05 Feeeliperesende

@Feeeliperesende Do you have the same issue with 0.74?

On top of that, the Podfile is a bit messy.

  1. Remove all the React- pods. React native install them for you
  2. For lottie, reanimated, firebase and all the react-native specific libraries, you should add them to the project using yarn add <name-of-the-library>, otherwise you risk to miss some automation
  3. move all the pod statements after the use_react_native( function. We run some code in that function and if you add some libraries BEFORE calling that function, some variables are not visible to them.

Let me know if the situation improves. Otherwise, please setup a reproducer using this template and I'll have a look at it!

cipolleschi avatar Jun 05 '24 14:06 cipolleschi