RN 0.38.0 React/RCTBridgeModule.h' file not found - ios

This is a long shot, but I've taken over a project done in RN v .38 and I need to update a library and resolve the build issues without updating the version of react native. I'm trying to update the react-native-aws-cognito-js library and while it looks to be compatible with the formatting change of import statements, I'm still not able to get it to build on IOS. Android is fine.
To reproduce my issue I did the following:
react-native init sample --version 0.38.0
cd sample
npm install react-native-aws-cognito-js
react-native link react-native-aws-cognito-js
react-native run-ios
Which fails with:
/node_modules/react-native-aws-cognito-js/ios/RNAWSCognito.h:4:9:
fatal error: 'React/RCTBridgeModule.h' file not found #import
Mobile and RN development is not my wheelhouse, but I'm hoping there is some sort of xcode configuration or tricks I can do to get this working and avoid a major overhaul. Running an upgrade to >.40 would probably take too long and also cause other compatibility issues that I don't have the time to resolve.
Note: I have tried the suggestions in `React/RCTBridgeModule.h` file not found

Related

'react/bridging/CallbackWrapper.h' file not found in React Native

I am trying to setup my React Native app on iOS, but on build, I am always getting this error:
'react/bridging/CallbackWrapper.h' file not found
I have been investigating on my own and found a few people with the same problem:
https://github.com/mrousavy/react-native-vision-camera/issues/1121
https://github.com/facebook/react-native/issues/34102
I have tried everything in these answers but no luck. Since it seems related to React Native Vision Camera, I also did everything stated in their troubleshooting page.
Unforrunately I still get the error. I built the project both using npx react-native run-ios (which throws an endless error) and using XCode itself, where I could find the real error.
Can you help me? The app works perfectly in Android. Thanks!
If nothing of the links I pasted in the question work, what finally worked for me was:
Updgrade React Native to >= 0.69.3 (my version was 0.69.0). To do that npx react-native upgrade.
Delete Pods folder and Podfile.lock from iOS folder. Run pod install.
And then building the project again.
The way to fix the problem is to comment-out the line :
s.header_dir = "react/bridging"
in
/node_modules/react-native/ReactCommon/React-bridging.podspec

'File not found' when integrating React Native with existing project

I'm having problems integrating React Native into my existing iOS project. When I run the project through Xcode, everything works as expected. However, when I run the project with through the terminal (using command: npx react-native run-ios), I get an error as follows:
fatal error: 'React/RCTRootView.h' file not found
#import <React/RCTRootView.h>
It's not just RCTRootView though, it's all react native imports. The setup is done with npm and cocoapods. If I remove all the import statements in the code, I instead get this error:
framework not found CoreModules
Steps I've taken:
I followed the steps on https://reactnative.dev/docs/integration-with-existing-apps to the letter
I searched for a long time on similar issues on SO and on the React Native GitHub issues page; none of the suggested solutions work.
The fact that it all works when running through Xcode was quite confusing. I run the same configuration and scheme when running through npx.
I found the answer halfway through writing the question, so I thought I might as well post it in case it might save someone some time in the future. It took me a while because the initial error I got wasn't the core problem.
The issue was caused by the fact that I'd forgotten to update the deployment target in the target deployment info (from iOS 9 to iOS 11).
Also some cred to where I found the solution:
https://github.com/facebook/react-native/issues/26106#issuecomment-600328194

React-Native: Build error GeneratedInfoPlistDotEnv.h file not found

I had a old React-Native project which I wanted to give it a try again and when trying to run the project on iOS (Android works perfect) I get the error that Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h file not found.
If I run the project from the command react-native run-ios, than the build will succeed.
What can cause this issue and how can it be fixed?
I have tried to fix it with the comments from this issue but no success.
React-Native verision: 0.47
Full error:
<built-in>:1:10: fatal error:
'/Users/myUser/Library/Developer/Xcode/DerivedData/Project-gcaxrvbcwgkfhkadevoqxcprxszw/Build/Products/Debug-iphonesimulator/GeneratedInfoPlistDotEnv.h' file not found
I fixed by copying file GeneratedInfoPlistDotEnv.h (in /ios/build/Build/Products/) to the path mentioned in the error message.
The path mentioned in error message for simulator is not same as real phone, you need to copy for a second time.
The development for React Native just like droped in a deep black hole, what you need to do is just climb and climb and climb...
Changing the Info.plist preprocessor prefix file to works for me ${CONFIGURATION_BUILD_DIR}/../GeneratedInfoPlistDotEnv.h
Image of code in Xcode 9
If you're coming from React version 0.60 and above, you should be referencing the package from GitHub instead of NPM. The author hasn't released auto-linking support on NPM yet, even though it's already merged!?
Try these steps after you unlink and uninstall the existing version of react-native-config. Remember to revert to default Info.plist preprocessor settings in XCode build settings.
yarn add https://github.com/luggit/react-native-config.git
cd ios && pod install
You don't have to add any other post-install scripts, just run the app like usual and it should work fine. Make sure you undo any other fixes before doing this.

build TVOS Example App with React Native using github.com/douglowder/react-native-appletv build errors

I am new to development, I have followed instructions, downloaded a zip of the dev's project,unzip,cd to folder, ran npm install and npm start
In the example app folders when trying to build in Xcode I get numberous React/RCT{file} file not found and will highlight an invalid import statement such as #import
I have been chasing this issue around github for days, tried numerous fixes such as updating the schemes, making an extra cocopods file that references the libraries functions
Anyone have a solution to this referencing problem?
these kinds of errors
https://github.com/facebook/react-native/issues/13371
Frankly I mightnt even be installing the project folder correctly, I dont know
thanks

React Native - Linked NativeModule works when run from Xcode, but not from packager

I recently added bugsnag-react-native and followed the directions for linking. When I run using the packager without Xcode, I get the following error screen.
When I search on Google for answers, the only relevant issue posted is Runtime Error: No Native client found which suggests that its a linking problem and to follow the directions, but from my perspective everything looks fine and I followed the direction.
What reason would a native module only be available when run from Xcode?
I had a similar issue and below solved it:
If you can successfully run from Xcode, then delete your ios/build folder (rm -rf ios/build) and re-run react-native run-ios.

Resources