gpt4 book ai didi

ios - React-native 独立应用程序在杀死端口 8081 后崩溃

转载 作者:行者123 更新时间:2023-11-29 05:50:03 25 4
gpt4 key购买 nike

我构建了一个 React-native ios 应用程序的发布版本,但当我终止端口 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 - React-native 独立应用程序在杀死端口 8081 后崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55757542/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com