ios - CircleCI + React Native + Xcode 10
问题描述
我有一个应用程序在 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
解决方案
在花了几个小时来弄清楚它发生了什么之后,我发现了这个问题:构建失败了,因为 CircleCI 上 Xcode 10.1.0 的 docker 镜像缺少 React Native 构建应用程序所需的一些依赖项。
错误只是说“main.jsbundle 不存在”。当 xcodereact-native-cli bundle
从react-native-xcode.sh
文件运行时会发生这种情况。它并没有说明错误的根本原因:watchman
此 Xcode 版本使用的 docker 映像中缺少。
为什么这些图像没有相同的安装包?我不知道。我只希望图像之间安装相同的软件包。
添加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
推荐阅读
- php - Symfony - 仅从一个 URL 将 404 重定向到自定义模板
- django - Web / 应用服务器配置 (Nginx / uWSGI / Django)
- r - ggplot2如何在单个面上叠加标记?
- c - 浮动不添加?
- jquery - 单击展开按钮和折叠按钮时如何在剑道树视图中执行“展开”和“折叠”
- node.js - nodemon + browserSync gulp 任务导致 EADDRINUSE :::3000 错误
- php - Axios 从 React 发布到 PHPmailer
- python - 如何限制函数内循环的迭代?
- c - 迭代 dfs 算法给出 sigkill 错误
- python - The Foundry Nuke – 在 QLabel 上显示动画值