Getting this error while building a react-native iOS app on xcode.
Started getting this error after npm install and rpm linking react-native-fs library. But
In my case this particular problem happened when I was trying to archive a 0.40+ react-native app for iOS (solution was found here: Reliable build on ^0.39.2 fails when upgrading to ^0.40.0).
What happened was that Xcode was trying to build the react-native libraries in parallel and was building libraries with implicit react dependencies before actually building the react library.
The solution in my case was to:
Disable the parallel builds:
Add react as a project dependecy
Make sure you disable Parallelise Build
and add React
target above your target
This error appeared for me after I ran pod install
command for the new dependencies. Along with those, React had also been installed. Therefore probably Xcode was confused for path. I removed these lines from PodFile and error was gone. Please note that those removed from here were already linked in Xcode.
target 'app' do
pod 'GoogleMaps'
pod 'Firebase/Auth', '~> 6.3.0'
pod 'Firebase/Database', '~> 6.3.0'
# Removed four pods below and it worked.
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNFS', :path => '../node_modules/react-native-fs'
end
Go to iOS folder in your project and install pod -
$ pod install
If you are getting any error in installation of pod type command-
$ xcode-select -p
Result should be - /Applications/Xcode.app/Contents/Developer
If the path is incorrect then open your iOS project in Xcode and go to: Xcode->preferences->command line tools-> select Xcode
And again install the pod your issue will be fixed.
If Libraries/React.xcodeproj
are red in xcode then reinstall node_modules
rm -rf node_modules && yarn
My newly created project from react-native 0.46.3 was red :S I have npm 5.3.0 and yarn 0.24.5 when I did react-native init
Change
#import "RCTBridgeModule.h"
to
#import "React/RCTBridgeModule.h"