IOS - Running script '[CP-User] Generate Specs The following build commands failed: PhaseScriptExecution [CP-User]\ Generate\ Specs In Azure Pipeline

1.7k views Asked by At

I am working with the azure pipeline for CICD for React native app. I am using macOS Big Sur (11.4) and Xcode 12.4 as a local machine to create and test the app. App working fine on the local machine without any warning or issue for ios. However, when I am pushing the code on the Azure pipeline it is giving me errors as below,

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

My observation is that the Azure pipeline does not have macOS Big Sur as Agent. My local machine changes some configurations during POD install and adds the script to support the latest Xcode and macOS and the azure pipeline agent does not support macOS Big Sur reason it is not able to execute the script.

enter image description here

NOTE: I have tried all clean processes like yarn, pod, or delete node_module.

[azure-devops]

1

There are 1 answers

0
Sandeep Rajbhar On

I have got the solution for the issue.

Actually, the latest version of macOS Big Sur (11.4) was not having a node install on VM.

A) I did some changes in the pipeline.

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) Also created patch inside react native lib for version 0.64. by adding "unset PREFIX" on node_modules/react-native/scripts/find-node.sh