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

Viewed 14562

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!

3 Answers

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

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.

Related