Performed RN upgrade from RN0.60 to RN0.61. Build failed with iOS, due to the following issue:
/react-native/React/Base/RCTBridgeModule.h:10:9: \'React/RCTDe
Here's my solution after spending a full day in digging the reason why,
.
.
.
.
You need to add .podspec to podfile for whichever 3rd party/custom library that complain unable to find React/{whatever.h}
If you are using a 3rd party library (Yarn/NPM/etc)
Copy podspec from other 3rd party library (eg, RNDeviceInfo/etc..)
Create own podspec by replacing a few item (s.name, s.source) I actually left others as default but you can modify as per your usage if you want
s.name = "NoSupportedLib"
s.source = { :git => "https://github.com/react-native-community/NoSupportedLibName.git", :tag => "v#{s.version}" }
You might want to take care the following, because not all your dependency may store under the folder path ios/**/your.m & your.h files
s.source_files = "ios/**/*.{h,m}"
Add new line to podfile
pod 'NoSupportedLib', :path => '../node_modules/NoSupportedLib'
Pod install
In the case where you have a local dependency, you should do the same as well (instead of adding the .a file into your Xcode's Linked Framework and Libraries.)
s.source = { :http => 'file:' + __dir__ + '/' }
s.source_files = "customLib/*.{h,m}"
pod 'customLib', :path => '../localDependency/customLib'
I tried adding React under my scheme as build target, apparently it does not help. I think for project that is >=RN0.60, we are meant to use autolinking provided by ReactNative? Hence to keep our Xcode's Linked Framework and Libraries clean.
I've had the same issue a while ago. It was fixed after: product > scheme > edit scheme
, go to the build tab and add react
as the first target.