我有一个应用程序在 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 镜像缺少构建应用程序所需的一些依赖项响应 native 。
错误只是说“main.jsbundle 不存在”。它发生在 xcode 从 react-native-xcode.sh
文件运行 react-native-cli bundle
时。而且它没有说明错误的根本原因: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
关于ios - CircleCI + React Native + Xcode 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54427035/