I'm encountering a problem when building my Flutter application using Xcode Cloud. During the build process, I get the following error:
Command PhaseScriptExecution failed with a nonzero exit code
To provide more context, this is the content of my ci_post_clone.sh file:
#!/bin/sh
# The default execution directory of this script is the ci_scripts directory.
cd $CI_WORKSPACE # change working directory to the root of your cloned repo.
# Install Flutter using git.
git clone https://github.com/flutter/flutter.git --depth 1 -b stable $HOME/flutter
export PATH="$PATH:$HOME/flutter/bin"
# Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms.
flutter precache --ios
# Install Flutter dependencies.
flutter pub get
# Install CocoaPods using Homebrew.
HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates.
brew install cocoapods
# Install CocoaPods dependencies.
cd ios
pod install # run `pod install` in the `ios` directory.
exit 0
I followed the steps of https://docs.flutter.dev/deployment/cd#xcode-cloud and added all the necessary parts.
I've tried searching for solutions to this issue but couldn't find any helpful information. Can anyone provide guidance on how to resolve this error?