Getting this error while using Fastlane to deploy firebase distribution of react native app.
It builds fine locally, only getting this error on CI.
[33m▸[0m [39;1mRunning script[0m 'Bundle React Native code and images'
2021-09-14T23:45:37.0115340Z [33mthe transform cache was reset.[0m
2021-09-14T23:45:37.0116230Z ** ARCHIVE FAILED **
2021-09-14T23:45:37.0116680Z
2021-09-14T23:45:37.0117040Z
2021-09-14T23:45:37.0117840Z The following build commands failed:
2021-09-14T23:45:37.0121970Z PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/runner/Library/Developer/Xcode/DerivedData/proj_name-ghtelxhdqifreogqusciceodxxjy/Build/Intermediates.noindex/ArchiveIntermediates/proj_name.firebasedistribution/IntermediateBuildFilesPath/proj_name.build/FirebaseDistribution-iphoneos/mobile.build/Script-00DD1BFF1BD5951E006B06BC.sh
2021-09-14T23:45:37.0125070Z (1 failure)
2021-09-14T23:45:37.0126250Z [23:45:24]: [31mExit status: 65[0m
2021-09-14T23:45:37.0126990Z [23:45:24]:
2021-09-14T23:45:37.0128480Z [23:45:24]: [33mMaybe the error shown is caused by using the wrong version of Xcode[0m
2021-09-14T23:45:37.0130200Z [23:45:24]: [33mFound multiple versions of Xcode in '/Applications/'[0m
2021-09-14T23:45:37.0131900Z [23:45:24]: [33mMake sure you selected the right version for your project[0m
2021-09-14T23:45:37.0134030Z [23:45:24]: [33mThis build process was executed using '/Applications/Xcode_12.4.app'[0m
2021-09-14T23:45:37.0135690Z [23:45:24]: [33mIf you want to update your Xcode path, either[0m
2021-09-14T23:45:37.0136580Z [23:45:24]:
2021-09-14T23:45:37.0137960Z [23:45:24]: - Specify the Xcode version in your Fastfile
2021-09-14T23:45:37.0139560Z [23:45:24]: ▸ [35mxcversion(version: "8.1") # Selects Xcode 8.1.0[0m
2021-09-14T23:45:37.0140440Z [23:45:24]:
2021-09-14T23:45:37.0141920Z [23:45:24]: - Specify an absolute path to your Xcode installation in your Fastfile
2021-09-14T23:45:37.0143580Z [23:45:24]: ▸ [35mxcode_select "/Applications/Xcode8.app"[0m
2021-09-14T23:45:37.0144470Z [23:45:24]:
2021-09-14T23:45:37.0145670Z [23:45:24]: - Manually update the path using
2021-09-14T23:45:37.0147210Z [23:45:24]: ▸ [35msudo xcode-select -s /Applications/Xcode.app[0m
2021-09-14T23:45:37.0148140Z [23:45:24]:
2021-09-14T23:45:37.0148540Z
2021-09-14T23:45:37.0149750Z +---------------+------------------------------+
2021-09-14T23:45:37.0151420Z | [32m[33mBuild environment[0m |
2021-09-14T23:45:37.0152920Z +---------------+------------------------------+
2021-09-14T23:45:37.0153960Z | xcode_path | /Applications/Xcode_12.4.app |
2021-09-14T23:45:37.0154900Z | gym_version | 2.192.0 |
2021-09-14T23:45:37.0156180Z | export_method | ad-hoc |
2021-09-14T23:45:37.0157130Z | sdk | iPhoneOS14.4.sdk |
2021-09-14T23:45:37.0158480Z +---------------+------------------------------+
2021-09-14T23:45:37.0159020Z
2021-09-14T23:45:37.0160290Z [23:45:25]: ▸ [35m at Generator.next (<anonymous>)[0m
2021-09-14T23:45:37.0162550Z [23:45:25]: ▸ [35m at asyncGeneratorStep (/Users/runner/work/proj_name/proj_name/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:24)[0m
2021-09-14T23:45:37.0165140Z [23:45:25]: ▸ [35m at _next (/Users/runner/work/proj_name/proj_name/node_modules/metro/src/DeltaBundler/traverseDependencies.js:159:9)[0m
2021-09-14T23:45:37.0167140Z [23:45:25]: ▸ [35minfo Run CLI with --verbose flag for more details.[0m
2021-09-14T23:45:37.0168770Z [23:45:25]: ▸ [35mCommand /bin/sh failed with exit code 1[0m
node-version: "14.17.3" xcode-version: 12.4
The Bundle react Native code and images,is already set to: ../node_modules/react-native/scripts/react-native-xcode.sh but nothing changed.
Running this on Github Actions CI
Approches tried
- Tried this where it adds node in front
node_modules/..
export NODE_BINARY=node
../node_modules/react-native/packager/react-native-xcode.sh"
- Changing this line inside Build React native code and Images export NODE_BINARY=node to export NODE_BINARY=$(which node)
- Tried adding
cd $PROJECT_DIR/..to the top of Build React native code and images
cd $PROJECT_DIR/..
export DEVELOPMENT_BUILD_CONFIGURATIONS="+(LocalDevelopment|FirebaseDistribution|Debug)"
export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh