React-native-fs: React/RCTBridgeModule.h file not found in RNFSManager.m after upgrade to RN 0.61.5

Created on 18 Dec 2019  路  4Comments  路  Source: itinance/react-native-fs

Hi,

I upgraded our project to RN0.61.5 and am now getting constantly the error:

React/RCTBridgeModule.h file not found in RNFSManager.m

Is this RN version not supported by the package? Thanks for supporting on this issue.

RN info

System:
    OS: macOS 10.15.2
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 166.36 MB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 26, 27, 28
      Build Tools: 23.0.1, 25.0.0, 26.0.3, 27.0.3, 28.0.1, 28.0.2, 28.0.3
      System Images: android-24 | Google APIs Intel x86 Atom, android-24 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: ^16.9.0 => 16.9.0
    react-native: ^0.61.5 => 0.61.5
  npmGlobalPackages:
    eslint-plugin-react-native: 3.5.0
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7

Podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'app' do
  # Pods 
  ## RN0.61.5
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-ART', :path => '../node_modules/react-native/Libraries/ART'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  ###
  # Community & 3rd party
  ###
  pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
  pod 'react-native-geolocation', :path => '../node_modules/@react-native-community/geolocation'
  pod 'react-native-maps', :path => '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => '../node_modules/react-native-maps'
  pod 'react-native-version-check', :path => '../node_modules/react-native-version-check'
  pod 'react-native-branch', path: '../node_modules/react-native-branch'
  pod 'react-native-amplitude-analytics', :path => '../node_modules/react-native-amplitude-analytics'
  pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
  pod 'react-native-calendar-events', :path => '../node_modules/react-native-calendar-events'

  pod 'RNAdyenCse', :path => '../node_modules/react-native-adyen-cse/ios'
  pod 'RNI18n', :path => '../node_modules/react-native-i18n'
  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
  pod 'RNBackgroundGeolocation', :path => '../node_modules/react-native-background-geolocation'
  pod 'RNBackgroundFetch', :path => '../node_modules/react-native-background-fetch'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
  pod 'RNImageCropPicker', :path =>  '../node_modules/react-native-image-crop-picker'
  # for RNImageCropPicker Dark mode support
  # https://github.com/ivpusic/react-native-image-crop-picker/releases/tag/v0.25.3
  pod 'QBImagePickerController', :path => '../node_modules/react-native-image-crop-picker/ios/QBImagePicker/QBImagePickerController.podspec'
  # https://github.com/ivpusic/react-native-image-crop-picker/issues/850
  pod 'RSKImageCropper', '2.0.1'
  pod 'RNFastImage', :path => '../node_modules/react-native-fast-image'
  pod 'RNRate', :path => '../node_modules/react-native-rate/ios'
  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

  #Google
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  pod 'Fabric'
  pod 'Crashlytics', '~> 3.14'
  pod 'ReactNativeFabric', :path => '../node_modules/react-native-fabric'
  pod 'GoogleIDFASupport', '~> 3.14.0'

  #Firebase
  pod 'Firebase/Core', '~> 6.3.0'
  pod 'Firebase/Messaging', '~> 6.3.0'

  # others
  pod 'Amplitude-iOS'
  pod 'AdyenCSE'
  pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
  pod 'instabug-reactnative', :path => '../node_modules/instabug-reactnative'


  pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'

  pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  pod 'react-native-version-number', :path => '../node_modules/react-native-version-number'

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'RNKeychain', :path => '../node_modules/react-native-keychain'

  pod 'ReactNativeDarkMode', :path => '../node_modules/react-native-dark-mode'

  pod 'RNShare', :path => '../node_modules/react-native-share'

  pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'

  pod 'react-native-cameraroll', :path => '../node_modules/@react-native-community/cameraroll'

  pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob' 

  pod 'RNLocalize', :path => '../node_modules/react-native-localize'

  pod 'RNFS', :path => '../node_modules/react-native-fs'


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

end

install! 'cocoapods',
         :deterministic_uuids => false

Most helpful comment

If you have the library added in your Podfile, make sure that you don't also have it included in the Libraries folder. My problem resolved my removing react-native-fs from the Libraries

All 4 comments

after upgrade from 0.60.5 to RN 0.61.5
All libraries are reporting error:

'React/RCT.h' file not found
Not just above error
I must use this workaround to fix it:

#if __has_include(<React/RCTAssert.h>)
#import <React/RCTAssert.h>
#import <React/RCTBridgeModule.h>
... tone of module here
#else
#import "RCTAssert.h"
#import "RCTBridgeModule.h"
... tone of module here
#endif

But If I do this, I need to modify so many files in /node_modules/react-native/... folder


How can I resolve that issue, it prevents me to build project

If you have the library added in your Podfile, make sure that you don't also have it included in the Libraries folder. My problem resolved my removing react-native-fs from the Libraries

It looks like this trick solved my problem. Thanks for pointing this out @gusoskar!

If you have the library added in your Podfile, make sure that you don't also have it included in the Libraries folder. My problem resolved my removing react-native-fs from the Libraries

This was also my case. thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PimDeWitte picture PimDeWitte  路  4Comments

AgNm picture AgNm  路  4Comments

quietautumn picture quietautumn  路  4Comments

1556173267 picture 1556173267  路  3Comments

JohnRyanTsai picture JohnRyanTsai  路  3Comments