Expo React Native iOS TestFlight生产构建启动即崩溃问题求助
Expo React Native iOS TestFlight生产构建启动即崩溃问题求助
大家好,我最近碰到一个极其诡异的Expo React Native iOS生产构建问题,折腾了好久都没解决,想请各位大佬帮忙分析下:
问题情况
我有一个基于Expo的React Native iOS应用,之前一直运行正常,但现在出现了奇怪的状况:用expo run:ios在模拟器上构建运行完全没问题,但打包生产版本上传到TestFlight后,打开APP就立刻崩溃。
Xcode控制台捕获的错误日志
崩溃时Xcode控制台输出以下错误:
Invariant Violation: Failed to call into JavaScript module method RCTDeviceEventEmitter.emit(). Module has not been registered as callable. Bridgeless Mode: false. Registered callable JavaScript modules (n = 0): . A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
Unhandled JS Exception: Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Bridgeless Mode: false. Registered callable JavaScript modules (n = 0): . A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Bridgeless Mode: false. Registered callable JavaScript modules (n = 0): . A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes', reason: 'Unhandled JS Exception: Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Bridgeless ..., stack: invariant@1965:25 __callFunction@28223:21 anonymous@28036:30 __guard@28162:14 callFunctionReturnFlushedQueue@28035:20 ' *** First throw call stack: (0x1833425fc 0x1808bd244 0x1026faeec 0x10239b15c 0x10239b984 0x183344e34 0x183343e7c 0x1833a7a38 0x10272fc90 0x102731da4 0x1027319f8<…>
已尝试的所有排查操作
我已经试过各种常规和非常规的方法,但都没解决问题:
- 全量更新了项目所有依赖包
- 反复核对应用入口文件路径,确认完全正确(至少检查了上万次)
- 克隆仓库回到上一次成功构建的提交,仅更新版本号后构建上传TestFlight,APP能正常运行;但把这个完全相同的代码复制到当前最新提交的仓库目录中,一行代码都没改,构建后却依然崩溃
- 删除本地仓库重新克隆到新目录,排除本地缓存污染问题
- 查阅了大量相关的GitHub issues和社区帖子,尝试了里面提到的所有解决方案,但都无效
- 怀疑过
react-native-reanimated或react-native-gesture-handler的版本兼容问题,但这两个依赖的版本自上次成功构建后没有变化,且和当前React Native(0.74.5)、Expo(51.0.39)版本完全兼容 - 多次运行
expo-doctor检查项目配置,没有发现异常 - 尝试移除自定义入口文件(index.js),改用Expo默认的入口文件构建,问题依然存在
- 更新了
@react-native-firebase相关依赖到与当前RN版本兼容的最新版 - 清理Xcode构建缓存、执行
expo prebuild --clean和pod install等常规清理重建操作 - 检查崩溃前的Xcode日志,没有发现任何有价值的前置错误信息
求助方向
现在我完全搞不懂,为什么完全相同的代码,在旧提交的仓库里能正常构建运行,复制到最新提交的仓库就会崩溃?有没有人遇到过类似的问题,或者有其他我没考虑到的排查方向可以建议?
备注:内容来源于stack exchange,提问作者PRSHL
相关产品推荐
相关产品推荐

