【问题标题】:How to build React Native App for iPhone?如何为 iPhone 构建 React Native App?
【发布时间】:2015-06-05 03:11:39
【问题描述】:

在 iPhone 模拟器上一切正常。为 iPhone 构建应用程序时出现错误:

创建 RCTRootView 需要 bundleURL

AppDelegate.m 中,我取消注释以下行;

jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

并将 prebuild main.jsbundle 下载到项目根目录下的 iOS 文件夹中:

curl http://localhost:8081/index.ios.bundle -o main.jsbundle

【问题讨论】:

标签: javascript ios react-native


【解决方案1】:

我忘记将文件添加到项目中。

您需要右键单击项目名称并选择“将文件添加到 MyProject...”。然后选择 main.jsbundle。构建项目,它应该可以工作。

【讨论】:

  • 是的,或者只是将 main.jsbundle 下载到应用程序根目录内的 iOS 文件夹中,而不是根目录本身。
猜你喜欢
  • 1970-01-01
  • 2020-11-14
  • 2016-05-30
  • 1970-01-01
  • 2022-08-17
  • 1970-01-01
  • 2022-11-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多