I have been trying to set up a custom dev client for use by all members of my team when developing an app that has native dependencies. However, while I have successfully integrated the launcher and dev-menu by following the instructions here, the integration only seems to work when running a Debug
configuration in XCode.
This is an issue because when a React Native app is built in debug mode, private APIs are included that simply do not pass the checks when submitting the app to TestFlight. In order to successfully publish the app to be accessed by our team, the app has to be built using a Release
configuration.
Previous attempts
While trying to adapt the project configuration in a way that would let me use a Release config while still including the Expo launcher/menu, I made this change to the podfile, with devclient
being a custom profile that is a copy of the default Release
configuration.
- pod 'expo-dev-launcher', path: '../node_modules/expo-dev-launcher', :configurations => :debug
+ pod 'expo-dev-launcher', path: '../node_modules/expo-dev-launcher', :configurations => :devclient
- pod 'expo-dev-menu', path: '../node_modules/expo-dev-menu', :configurations => :debug
+ pod 'expo-dev-menu', path: '../node_modules/expo-dev-menu', :configurations => :devclient
This almost worked. Scanning a QR code from a terminal running expo start --dev-client
opened the app correctly and Metro started building the bundle. But as soon as it was done, the app immidiately crashed. Curious as to what may have caused it, I attached the XCode debugger and found that this error was causing the crash:
[error][tid:com.facebook.react.JavaScript] Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
[fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
Conclusion and question
The fact that everything works correctly in a Debug configuration, but not in a Release configuration, leads me to believe that the launcher cannot be included without running the app in debug mode. Is this true, and if it is, can anyone suggest a workaround? The last resort would of course be to compile .ipa
files and distribute them to the team manually, but that would require us to collect the UUIDs of every team member’s devices which I’d like to avoid if it is possible.