I’ve run into an interesting issue attempting to get the latest react-native-firebase working with Expo 46 and EAS. The App would build, install and work locally, but when I cut an internal or store build on EAS it would crash on launch in iOS.
After a lot of trial and error, I created an example repo, and ultimately determined the issue was Hermes on iOS.
As far as I can tell, Hermes does not work with react-native-firebase on 0.69.x and Expo SDK 46. Here is an working example repo without Hermes. If you add jsEngine: "hermes"
to app.json, and cut a new build on EAS, the same code base crashes on iOS.
This only happens on EAS builds. It works fine locally, unfortunately, but internal or store builds crash on launch. Android works fine.
package.json
"expo": "~46.0.16",
"expo-dev-client": "~1.3.1",
"expo-build-properties": "~0.3.0",
"@react-native-firebase/analytics": "^16.2.0",
"@react-native-firebase/app": "~16.2.0",
"@react-native-firebase/crashlytics": "^16.2.0",
"@react-native-firebase/perf": "^16.2.0",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.6",
app.json
"plugins": [
[
"expo-build-properties",
{
"ios": {
"useFrameworks": "static"
}
}
],
"@react-native-firebase/app",
"@react-native-firebase/crashlytics",
"@react-native-firebase/perf"
]
This appears to be the crash error:
*** Terminating app due to uncaught exception 'RCTFatalException: Could not get BatchedBridge, make sure your bundle is packaged correctly', reason: 'Could not get BatchedBridge, make sure your bundle is packaged correctly'
*** First throw call stack:
(0x1d71ad288 0x1efedd744 0x10471f5f0 0x1047372bc 0x1047357f8 0x10474a0c4 0x104749e58 0x1d71865a4 0x1d7187500 0x1d711f048 0x1d7132bc8 0x104733078 0x1d897541c 0x2483699ac 0x248368e68)
I posted to a react-native-firebase discussion and the maintainer suggested:
Either the bundle was not compiled + included + archived correctly or Hermes is not able to find it for some reason. Not a react-native-firebase thing I don't think. You might try same with hermes+frameworks + app-with-no-other-modules
Anyone have any ideas why react-native-firebase
would work locally on iOS with Hermes, but iOS EAS builds crash on launch? Any suggestions or insight would be greatly appreciated.