react-native undefined is not an object (evaluating RCCManager.setRootController) - ios

I'm trying to make a simple react-native app with redux and redux-saga tie-ins. Unfortunately, when I try to run the app (whether using react-native run-ios or running through Xcode, I get the following error:
Strangely enough, when I ported things like the Counter example for redux-saga to react-native or other examples I don't have this issue. I'm wondering if someone could help point to where things could be going wrong?

So turns out I just needed to link some more libraries together.
Reinstalling these components helped:
npm install --save react-native
and
npm install --save react-native-controllers
followed by rnpm link fixed the issue

Here is another solution based on my own failure:
Through rechecking iOS installation doc, I found out some tricky differences in the #4 requirement:
It clearly says project row instead of target row. This time I selected 'project' row and add do what the #4 instruction told to do. Then it solved the problem. Hopefully my solution will be found helpful.

I faced a similar problem and it was because somehow the setup I made for the Xcode project were lost, so following the instructions I made them again and the problem was solved.

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

UMModuleRegistryAdapter.h not found when running React Native app in iOS simulator

I have a simple React Native app that I've been testing on Android and now want to test on iOS. It's using React Navigation.
I ran npm run ios but I'm getting the following error:
info In file included from
/Users/rbbit/reactnative/testproj1/ios/testproj1/main.m:10:
/Users/rbbit/reactnative/testproj1/ios/testproj1/AppDelegate.h:9:9: fatal error: 'UMReactNativeAdapter/UMModuleRegistryAdapter.h' file not found
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
info 1 error generated.
I opened XCode but I'm basically getting the same message, nothing else that would help me debug this.
I do see that there is a package called react-native-adapter (https://github.com/expo/expo/tree/master/packages/%40unimodules/react-native-adapter), however I'm hesitant to just install this since I followed the instructions on how to include react-navigation and didn't mention that, assuming this is related.
Also, that page says If you are using react-native-unimodules, this package will already be installed and configured!, and react-native-unimodules already is in my dependencies.
Any pointers on how to solve this? Thank you!
For latest RN versions (RN 0.60+) errors like this should be fixed with the auto-linking and just running a pod install.
For older versions you should try:
react-native link in the root folder of your project
Then in Xcode Product->Clean Build folder, restart JS server and attempt to rebuild.
If still not working double check the configs from here:
https://github.com/unimodules/react-native-unimodules
and the App.delegate from here:
https://gist.github.com/brentvatne/1ece8c32a3c5c9d0ac3a470460c65603
Sources:
Pod install reminder was first suggested by Sandy in the below comment
pod install didn't work for me until I added these lines to my pod file:
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
And
use_unimodules!(modules_paths: ['../node_modules'])
Then do a pod install.
Example: https://gist.github.com/sjchmiela/6c079f2173938a9a61a7c6f053c45000
I had this exact same error with everything configured correctly, everything in the other answers done and all the unimodules installation steps already done, on a project that had worked for months, building it on a new computer. It turned out the reason was because I was simply using the wrong file in xCode.
I had opened the .xcodeproj file when I should have opened and run the build from the .xcworkspace file.
Everything seemed to work as normal apart from this error, which made it look like a configuration problem rather than a simple "you opened the wrong file" problem. Hopefully if someone else makes the same mistake, this will save them a few hours of fruitless tinkering.

installReactHook is not a function / installReactHook is undefined

Suddenly I can't get my react native project to start on ios simulator or device. I don't know what happened in between. I tried to clear all cache, reinstalled the node modules, pod install, but nothing works. Can't find anything except that in the react native documentation that this is part of Systrace. I'm stumped.
I did run npm link yesterday - maybe it messed something up, but still after that building was not an issue.
I'm sure i messed something up myself, but hopefully someone has a hint.
Not sure this will help, but sometimes cleaning the ios build folder fixes weird things
This was a bit of a headache.
I also saw the error Module AppRegistry is not a registered callable module (calling runApplication). But that was not really the issue.
Whilst checking if android build has similar problem, I found that the module react-native-animated-linear-gradient had two issues
It gave problems with ReactNativeFeatureFlags.js.
It had a duplicate definition of react-native (as if it also included the whole react-native project through its package.json
By continuing to remove this package completely, unlinking it manually, reinstalling npm packages and cleaning my npm cache I finally got it to work again, both on android and ios.
I wasn't using that package, but due to lingering in my package.json and running npm update it went and broke something in my setup I suspect. If only I had removed it completely after not testing and deciding not using it.
I hope it helps people giving direction if you suddenly see installreacthook not found. It costs me 4 hours to figure out.

<RCTBridgeModule.h> can't be found for iOS Build

Failed to find rctbridgemodule.h
Hey guys,
i got this issue with xcode for my react-native project.
My coworker updated our project to a new revision and updated react-native itself how he said. After that the IOS Build doesn't work like it used to.
Android is all set, everything works just as beautiful as before.
I tried to solve it with this solution:
https://github.com/brentvatne/react-native-svgkit/issues/11
but it didn't work for me.
Just deleted and installed the node_modules a couple of times and reinstalled it using npm i and npm install.
But no success.
Would be a blessing if you could help me!

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