ios - 杀死端口 8081 后 React-native 独立应用程序崩溃
问题描述
我构建了 react-native ios 应用程序的发布版本,但是当我杀死 port 时应用程序崩溃了8081
。
解决方案
您必须在构建应用程序之前捆绑资产,
第 1 步:在您的 react native 项目中运行此命令
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
第 2 步:编辑从调试到发布的构建方案。
第 3 步:替换 appdelegate.m 文件中的代码
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
对此
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
现在您可以构建您的 ios 应用程序的发布版本。
希望这可以帮助 ;-)
推荐阅读
- ios - 启动屏幕中的 PDF 矢量图像,在设备上无法正确缩放
- javascript - 使用 d3.js 根据我的 xAxis 文本调整图表大小
- django - 将变量共享到 django 中包含的模板
- google-cloud-platform - Argo 与多个 GCP 项目
- python - 从蓝图部署的排队后台工作线程中缺少 Flask 应用程序上下文
- r - 如何仅从某些列在 R 中创建分组条形图?
- excel - 为什么我的 Range 变量出现 Object Required 错误
- c# - 实体框架查询 - 仅选择记录,直到另一个表中的时间戳
- python - Flask - 反序列化 JSON 并加载到 Postgres DB
- python - 单击输入后Python3不接受我的键盘输入