0

我正在为 React 本机应用程序使用 CICD 的 azure 管道。我使用 macOS Big Sur (11.4) 和 Xcode 12.4 作为本地机器来创建和测试应用程序。应用程序在本地机器上运行良好,没有任何 ios 警告或问题。但是,当我在 Azure 管道上推送代码时,它给了我如下错误,

2021-07-27T07:16:59.6470190Z ▸ Building library libRCTTypeSafety.a
2021-07-27T07:17:00.2028870Z ▸ Running script '[CP-User] Generate Specs' 
2021-07-27T07:17:01.2282870Z ** BUILD FAILED **
2021-07-27T07:17:01.2284310Z 
2021-07-27T07:17:01.2284960Z
2021-07-27T07:17:01.2285770Z The following build commands failed: 
2021-07-27T07:17:01.2288070Z PhaseScriptExecution [CP-User] Generate\ Specs /Users/runner/Library/Developer/Xcode/DerivedData/QualityGateTest-fpifffctlauicvdetlisjqinofwg/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/FBReactNativeSpec.build/Script-650A047D1ACF74FC1AD8108A78938588.sh 
2021-07-27T07:17:01.2289360Z (1 failure) 
2021-07-27T07:17:01.2705660Z ##[debug]success of first tool:false 
2021-07-27T07:17:01.2787820Z ##[debug]rc:0 
2021-07-27T07:17:01.2788560Z ##[debug]success:true 
2021-07-27T07:17:01.2807190Z ##[debug]task result: Failed 
2021-07-27T07:17:01.2844600Z ##[error]Error: /usr/bin/xcodebuild failed with return code: 65 
2021-07-27T07:17:01.2856630Z ##[debug]Processed: ##vso[task.issue type=error;]Error: /usr/bin/xcodebuild failed with return code: 65 
2021-07-27T07:17:01.2866680Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: /usr/bin/xcodebuild failed with return code: 65 
2021-07-27T07:17:01.2867800Z ##[debug]Agent.Version=2.189.0

我的观察是 Azure 管道没有 macOS Big Sur 作为代理。我的本地机器在 POD 安装期间更改了一些配置,并添加了脚本以支持最新的 Xcode 和 macOS,而 azure 管道代理不支持 macOS Big Sur,因为它无法执行脚本。

在此处输入图像描述

注意:我已经尝试过所有干净的进程,比如 yarn、pod 或 delete node_module。

[天蓝色-devops]

4

1 回答 1

1

我已经得到了这个问题的解决方案。

实际上,最新版本的 macOS Big Sur (11.4) 没有在 VM 上安装节点。

A)我在管道中做了一些改变。

pool:
  vmImage: macOS-11

steps:

- checkout: self
  persistCredentials: true
  clean: true

- task: NodeTool@0
  displayName: 'Install Node'
  inputs:
    versionSpec: 'v16.6.2' # you can use your desired version here

- script: yarn install
  displayName: Install Dependencies

B)还在版本 0.64 的 react native lib 中创建了补丁。通过在 node_modules/react-native/scripts/find-node.sh 上添加“未设置前缀”

于 2021-08-30T15:25:46.027 回答