首页 > 解决方案 > iOS 应用程序无法在 fastlane 中构建,但可以在 Xcode 中运行

问题描述

我正在构建一个 React Native 应用程序并使用 Fastlane 来管理我的签名、构建和部署。我正在尝试构建一个临时包,但每次我使用 Fastlane 运行构建时gym,都会收到一条关于缺少头文件的错误消息。构建在 Xcode 中的 Product -> Build 中运行良好,我可以在本地模拟器中运行该应用程序。

我看到的错误消息来自gym AppDelegate.m:13:9: 'ReactNativeNavigation/ReactNativeNavigation.h' file not found,我知道它与React Native Navigation setup相关联,并且已按照步骤进行修复。

以前有没有人看到过这个错误,或者对如何获得有关 Xcode 构建工作原因的更多信息有任何建议?我试过擦洗我的build,podsnode_modules目录但没有运气。我正在使用 React Native 0.59.9 和 Xcode 11.3.1。

这就是我的Fastfile

match(
  type: "adhoc",
  git_branch: "master",
  git_url: "<my cert repo>",
  app_identifier: ["<main app ID>", "<app extension ID"],
  team_id: "<my team ID>",
  readonly: true,
)
sh('yarn', 'build:ios')
gym(
  workspace: "myApp.xcworkspace",
  scheme: "myApp",
  configuration: "Beta",
  export_method: 'ad-hoc',
  output_directory: "builds",
  output_name: ipaName,
)

仅供参考,在这种情况下yarn build:ios是别名react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --assets-dest ios --platform ios

标签: iosxcodereact-nativefastlanefastlane-gym

解决方案


您不必调用 yarn build:ios。健身房应该照顾它。


推荐阅读