CircleCI + React Native + Xcode 10

时间:2019-01-29 18:00:09

标签: ios xcode react-native circleci fastlane

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

但是,当我切换它时,即使启用了遗留系统(-UseNewBuildSystem=NO-UseModernBuildSystem=0传递给Fastlane的build_ios_app),Ci也停止工作,我得到的是“ 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

1 个答案:

答案 0 :(得分:7)

花了几个小时只是想弄清楚它是怎么回事之后,我才发现了问题:构建无声地失败了,因为CircleCI上Xcode 10.1.0的docker镜像缺少构建应用程序所需的一些依赖关系。反应原生。

在错误只是说“main.jsbundle不存在”。当xcode从react-native-cli bundle文件运行react-native-xcode.sh时,就会发生这种情况。而且它不会告诉了错误的根本原因:watchman缺少这个版本的Xcode中使用的码头工人形象。

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

添加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