Build failures in UBA due to Xcode issues can stem from incompatible Cocoapods versions required by certain plugins. To resolve this, check your local Cocoapods version with `pod --version` and use a pre-build script in UBA to install the needed Cocoapods version, such as 1.15.2, ensuring compatibility before the build process starts.
Symptoms
- My builds are failing due to Xcode build failures.
- I need to update my Cocoapods version in UBA due to plugin compatibility.
Cause
Some plugins/packages, require certain versions of Cocoapods to run properly or have bugs with some versions of Cocoapods. Generally, this information is available from the package information/source.
If your project is building locally but fails during the Xcode build in UBA, and you suspect the Cocoapods version is the issue, you can check your local version of Cocoapods from the terminal with the command:
pod --version Resolution
Using a pre-build script, you can install a different version of Cocoapods on the UBA builders. For example, to install Cocoapods 1.15.2 you can use a bash script like this:
#!/bin/bash
#This is a sample script to install cocoapods 1.15.2
echo "START"
gem install cocoapods -v 1.15.2 --no-document
echo "current cocoapods version: "
gem which cocoapodsTo set the script to execute at the start of the build (before the Editor build), use the appropriate field in the advanced build target configuration:
More Information
Build Target Configuration (Script hooks/Pre-build Script)