1

I have created a workflow with Xcode Cloud to compile (archive) and release my app to TestFlight when a new commit is pushed on master branch. I created the workflow on Xcode, I gave permissions to the repo on Xcode, I added ci_post_clone.sh script as Flutter documentation suggests, and everything was working fine until today. When I pushed a new feature on origin/master the workflow started as expected but then it was stopped by an error on the ci_post_clone.sh script:

fatal: Not a valid object name origin/master Command exited with non-zero exit-code: 128

This is what I have on the script that was working fine until today:

#!/bin/sh

set -e

cd $CI_PRIMARY_REPOSITORY_PATH # change working directory to the root of your cloned repo.

echo "Installing Flutter using git"
git clone https://github.com/flutter/flutter.git --depth 1 -b stable $HOME/flutter
export PATH="$PATH:$HOME/flutter/bin"

echo "Flutter artifacts"
flutter precache --ios

... more commands here.....

It fails when trying to execute the first flutter command. I tried to change the command using flutter clean, commenting this command and trying the next one, but same result.

I tried to clean my project on local and execute it again, everything seems fine.

I'm using last Xcode release version 16.2, last macOS release version Sequoia 15.3 on the workflow and last stable Flutter version 3.29.

1 Answer 1

5

I had this exact issue today. I solved it with curl and unzip.

Replace these lines

echo "Installing Flutter using git"
git clone https://github.com/flutter/flutter.git --depth 1 -b stable $HOME/flutter

with these:

# Install Flutter using curl.
curl -sLO "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.29.0-stable.zip"
unzip -qq flutter_macos_3.29.0-stable.zip -d $HOME
Sign up to request clarification or add additional context in comments.

2 Comments

It's working like a charm, I cannot understand why git clone is not working properly, is there any blocking on Apple side?
Most likely, the one using git clone was trying to configure it for macos after cloning, but hitting an internal error. I tried to downgrade both Xcode and macOS versions, but still didn't work. This curl method was the easiest and fastest solution for me for time being.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.