【问题标题】:CircleCI + React Native + Xcode 10CircleCI + React Native + Xcode 10
【发布时间】:2019-06-22 22:24:46
【问题描述】:

我有一个应用程序在 Xcode 9 上的 CircleCI 上使用 React Native 0.57.7 运行良好。 但是我们需要将 Xcode 版本升级到 10.1.0。

但是当我切换它时,Ci 停止工作,即使启用旧系统(-UseNewBuildSystem=NO-UseModernBuildSystem=0 被传递给 Fastlane 的 build_ios_app),我得到“Myapp.app/main.jsbundle 不存在”错误。

▸ + echo 'error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with'
▸ error: File /Users/distiller/project/ios/build/Build/Intermediates.noindex/ArchiveIntermediates/Myapp/BuildProductsPath/Release-iphoneos/Myapp.app/main.jsbundle does not exist. This must be a bug with
▸ + echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
▸ React Native, please report it here: https://github.com/facebook/react-native/issues

【问题讨论】:

  • 上面写着:“请在此举报:github.com/facebook/react-native/issues
  • 我不知道它是否是一个错误。我想先看看有没有人有过。谢谢
  • 那么你似乎不擅长搜索:在GitHubStackOverflow 上都可以找到它。
  • 谢谢,但这是我做的第一件事!

标签: ios xcode react-native circleci fastlane


【解决方案1】:

花了几个小时才弄清楚它发生了什么,我发现了问题:构建失败,因为 CircleCI 上 Xcode 10.1.0 的 docker 映像缺少构建应用程序所需的一些依赖项反应原生。

错误只是说“main.jsbundle 不存在”。当 xcode 从 react-native-xcode.sh 文件运行 react-native-cli bundle 时会发生这种情况。它并没有说明错误的根本原因:此 Xcode 版本使用的 docker 映像中缺少 watchman

为什么这些图像没有相同的安装包?我不知道。我只希望图像之间安装相同的软件包。

添加brew install watchman 使 CI 再次通过:

- run:
    name: "Install React Native dependencies"
    command: |
      brew update
      brew install watchman

我希望react-native-xcode.sh 可以返回根错误,而不仅仅是main.jsbundle does not exist

【讨论】:

  • 非常感谢。这为我解决了它。你是怎么知道的?
  • 我尝试了很多东西。但是引导我走向这个方向的一个原因是:我添加了一个 ci 作业来运行react-native bundle(由 react-native-xcode.sh 在内部运行),并且出现了一个错误,指出未找到守望者。
  • 我的男人。你是救生员
  • 非常感谢!修复了我的 circleci 构建
  • 非常感谢。这帮助我找到了捆绑失败中的实际问题。
猜你喜欢
  • 1970-01-01
  • 2019-04-04
  • 2020-03-10
  • 1970-01-01
  • 2019-12-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-14
相关资源
最近更新 更多