ios - 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 传播运算符错误吗?
解决方案
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.
推荐阅读
- liquibase - Liquibase generateChangeLog 命令生成无变更集
- javascript - 如何在 Javascript 中将 ArrayBuffer 转换为 11 位值并再次返回
- go - 如何在 Go 中获取包含数据结构的结构的大小?
- angular5 - 向 Material Autocomplete 添加加载指示器
- google-cloud-kms - 使用存储在 Google Cloud KMS 中的密钥签署区块链交易
- python - 将键映射到python目录中的值
- python - AWS Lambda Policy Length Exceeded - 向 lambda 函数添加规则
- c# - 如何处理因 INotifyPropertyChanged 事件导致的内存泄漏问题?
- python - 如何在 Windows 10 PC 上使用 Python 3.7 和 Mutagen 写入 ID3 标签 WFED URL 框架
- c# - Model Binding with Nested JSON Objects