An issue I've encountered with iOS after ejecting.

Sorry if this is not the place to post this, I’m new here and I’ve already figured this issue out so I’m not necessarily asking for help.

Before ejecting Expo (because I needed to use Mapbox), I was using Windows and I’ve only built Android apps. When I ejected, the iOS directory was missing. This was fine for a while, but then the time to build an iOS app came. This caused quite a headache.

First of all, I needed to find a way to generate the iOS folder. I was advised to create another project with the react-native CLI, and then copy the iOS folder back to the main project. This seemingly worked, until I went to build it.

I was getting a crash saying that Application <appname> has not been registered. This seemed very weird because a release build was working just fine on Android. After digging around for hours and hours, I finally figured out what happened.

When React Native generates an iOS project, the moduleName is set to the name of the project. But when I register my app with Expo’s registerRootComponent, it calls registerComponent with the moduleName of main, which causes issues when copying the iOS folder generated by React Native over to the ejected Expo project. As far as I can see, this behaviour is only mentioned in the comment that Expo generates.

Please add this to a wiki page/troubleshooting guide. This was very frustrating.

1 Like