React-native-fs: Failed to build with RN 0.61 React/RCTImageLoader.h file not found

Created on 27 Sep 2019  路  15Comments  路  Source: itinance/react-native-fs

RNFSManager.m fatal error: React/RCTImageLoader.h file not found during IOS build

Looks like RCTImageLoader is removed from React Native Libraries. Anyone can suggest a permanent / temporary fix?

Same issue is observed for other libraries too.
https://github.com/ivpusic/react-native-image-crop-picker/issues/692#issuecomment-529017012

I have tried adding RCTImage to RNFS.podspec file manually but i could not succeed to prevent failure.

Most helpful comment

import

=>

import

All 15 comments

Same issue here.

I am using ^2.14.1 and am still getting this issue. Here is my PodFile:

platform :ios, '9.0'
target 'familyApp' do

  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :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-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 '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'
  pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'
  pod 'Analytics'
  pod 'Firebase/Core', '~> 6.2.0'
  pod 'Firebase/DynamicLinks', '~> 6.2.0'
  pod 'Fabric', '~> 1.7.13'
  pod 'Crashlytics', '~> 3.10.7'
  pod 'Intercom'

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

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

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

  pod 'RNOpenAppSettings', :path => '../node_modules/react-native-app-settings'

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

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

  pod 'RNSecureKeyStore', :path => '../node_modules/react-native-secure-key-store/ios'


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

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

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

I have the opposite problem: I'm on React Native 0.60.5 and versions newer than 2.14.1 break my iOS build with React/RCTImageLoaderProtocol.h not found. Not sure if you're worried about backwards compatibility, but I can put in a PR on the Readme at least.

import

=>

import

RNFSManager.m fatal error: React/RCTImageLoader.h file not found during IOS build

Looks like RCTImageLoader is removed from React Native Libraries. Anyone can suggest a permanent / temporary fix?

Same issue is observed for other libraries too.
ivpusic/react-native-image-crop-picker#692 (comment)

I have tried adding RCTImage to RNFS.podspec file manually but i could not succeed to prevent failure.

Any updates here?

Same issue here.

import

=>

import

Same issue here. But this works for me locally

[Resolved]

  1. Clean the derived data folder.
  2. Make sure the dependencies are matching with the installed version of RN.
  3. Clean and build, it works.

+1

fresh project created with

npx react-native init avid --template [email protected]

it uses react-native 0.61.2

I install latest react-native-fs

    "react-native-fs": "^2.16.2",

Still fails to build

myProject/node_modules/react-native-fs/RNFSManager.m:17:9: 'React/RCTImageLoaderProtocol.h' file not found

Any solutions for this?

+1

This issue has been driving me nuts for weeks!

any solution for this? it would be a great help if this will be fixed sooner.

#if __has_include(<React/RCTImageLoader.h>)
#import <React/RCTImageLoader.h>
#else
#import <React/RCTImageLoaderProtocol.h>
#endif

This worked for me

Thanx for this, @davidten ! Just published 2.16.3 with this include-bridge.

Was this page helpful?
0 / 5 - 0 ratings