React-native-screens: 'React/RCTImageView.h' file not found | iOS Build Failed

Created on 11 Mar 2020  路  22Comments  路  Source: software-mansion/react-native-screens

Error - node_modules/react-native-screens/ios/RNSScreenStackHeaderConfig.m 'React/RCTImageView.h' file not found

Versions

"react-native-screens": "2.3.0",
"react": "16.8.3",
"react-native": "0.59.8",
"react-navigation": "^3.1.2"
bug

Most helpful comment

it is easy do this :

//#import

import

and
//#import

import

if you have error with RCTImageLoader
do same thing:
//#import

import

All 22 comments

Same here

"react-native-screens": "^2.3.0",
"react": "16.8.3",
"react-native": "0.59.9",
"react-navigation": "^3.11.0",

I'm having the same issue with react-navigation 4.1

@tvhimanshu have you found a fix for this

Unlinking and the downgrading the package to a lower package worked for me

Does the issue still exist in v. 2.4.0?

@WoLewicki was experiencing the issue when using a lower version

@WoLewicki was experiencing the issue when using a lower version

sorry, I meant to say latest version

So it is still there in v. 2.4.0 yes? Can you provide a repo with minimal configuration needed that shows this bug?

I'm seeing a similar issue on 2.4.0 trying to build on iOS.

`fatal error: 'React/RCTImageLoader.h' file not found

import `

This is not an issue on android.

        "react": "^16.8.6",
        "react-native": "0.61",
        "react-native-ble-plx": "1.1.0",
        "react-native-elements": "1.2.7",
        "react-native-gesture-handler": "1.6.0",
        "react-native-paper": "3.6.0",
        "react-native-reanimated": "1.7.0",
        "react-native-safe-area-context": "0.7.3",
        "react-native-screens": "2.4.0",

@WoLewicki I can try to rip apart my code base later to produce a minimal example if I don't find a solution soon.

Fixed. Most likely one of the modules is missing from your podfile.

After adding pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'

I was able to get my app running using react-native-screen 2.4.0 and react-native 0.62 with react-navigation 5.0

Make sure to run pod install --repo-update in your ios folder.

Here is my pods for react if that helps anyone

  pod 'React', :path => '../node_modules/react-native/'
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-Core/RCTWebSocket', :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 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'

is there any update on this PR? It fixes the issue.

any progress for this issue???

Can you check if this issue happens when you create a new project with react-native version >=0.60.0? Because if not, then it seems like not an issue of the library itself.

any progress for this issue???

I tested if the error appears on a new project in every RN version supported by react-native-screens: 0.60, 0.61, 0.62, 0.63, and on each of these versions using react-native-screens does not cause any errors. This issue may come from not properly upgrading from one of the older versions of RN and is not in scope of the library. I am closing this issue then. Feel free to comment if you have any questions or you can reproduce this issue in a new project.

Fixed. Most likely one of the modules is missing from your podfile.

After adding pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'

I was able to get my app running using react-native-screen 2.4.0 and react-native 0.62 with react-navigation 5.0

Make sure to run pod install --repo-update in your ios folder.

Here is my pods for react if that helps anyone

  pod 'React', :path => '../node_modules/react-native/'
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-Core/RCTWebSocket', :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 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'

This doesn't seem to work for older versions, like the OP who is using RN 0.59... I have 0.60.5 and my node_modules/react-native/React/ does not contain a CoreModules file... just React-Core, React-DevSupport, and React-RCTFabric

it is easy do this :

//#import

import

and
//#import

import

if you have error with RCTImageLoader
do same thing:
//#import

import

@hadijoons where do you add that code?

@JeffAbney This helped me: https://react-native-community.github.io/upgrade-helper/

Just choose the version you're moving from and to, and it will show you everything you need to change in every file that needs to be changed or added. I'm able to launch the simulators from Xcode successfully after following that.

@hadijoons YOU ARE THE CHOSEN ONE! xD Thank you so much, no solutions worked for me except your one, you saved me from wasting much more time on this problem.

P.S. Another fix for this problem is updating react-native to 0.60 or higher, since 0.60 is the lowest version officially supported by react-native-screens
image

@hadijoons where do you add that code?

it is easy do this :

//#import

import

and
//#import

import

if you have error with RCTImageLoader
do same thing:
//#import

import

It worked for me.

I had to do a search of every import you mentioned and replaced all of them.

I was able to fix this issue, downgrading the react-native-screens to version 2.9.0 solved the issue. If you are working on RN 0.60.x and you can do this to easily fix this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pvinis picture pvinis  路  5Comments

thomasgosse picture thomasgosse  路  4Comments

sibelius picture sibelius  路  3Comments

OmarBasem picture OmarBasem  路  4Comments

jeveloper picture jeveloper  路  5Comments