首页 > 解决方案 > React Native 应用程序在 iOS TestFlight 上立即崩溃

问题描述

我讨厌问这个开放式的问题,但我是在连续 4 天的试验、错误和纯粹的绝望之后问的。

我的问题是:

为 TestFlight 捆绑 React Native 应用程序是否有任何不明显的“陷阱”?因为我的应用程序在启动时崩溃,但仅在 TestFlight 中。崩溃报告仅显示 RCTFatal(下面的屏幕截图)。

我的 RN (0.54) 构建包括用于我的 JS 包的 CodePush,我在归档时使用发布方案/生产证书方案,遵循 CodePush/React Native 的所有指示。该应用程序有效,但打包时无效。任何想法,或最好的猜测可能是什么情况?

更新:

当我在模拟器上运行我的发布方案时,它会抛出一个错误:

更新(2): 对话已移至聊天:https ://chat.stackoverflow.com/rooms/170610/discussion-on-question-by-user1791914-react-native-app-crashes-immediately-on-io

更新(3): 这个问题仍然是相关的,但我已经打开了一个单独的问题作为调试,因为揭示了更多信息:React Native bundle error for Release,Babel not working?

React Native / Babel 没有正确编译传播运算符,所以这是一个需要排序的配置问题。

Unhandled JS Exception: Unexpected token '...'.

这是 Babel 传播运算符错误吗?

在此处输入图像描述

标签: iosreact-nativetestflightreact-native-iosreact-native-code-push

解决方案


So this turned out to be a syntax/js issue after all and had nothing to do with my build. I had an instance with

{...props.children} which should have been {props.children}

in one of my jsx files. This was causing really inconsistent results with the app crashing in some cases and not in others. It also led me on a wile goose chase trying to reconfigure babel and my release build as the Debug build was handling the error silently.


推荐阅读