-
If you are looking for help, please confirm the following...
Which mobile framework are you using?Flutter (Dart) Steps to reproduce
Expected resultsBuild succesful Actual resultsBuild fails with: Performed checks:
Build id (optional)677cd43f55fc02e0a02b5511 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 18 replies
-
Hello @verscph,
If you still run into this issue, can you please SSH into the builder's virtual machine and confirm the |
Beta Was this translation helpful? Give feedback.
-
Hi @dam-ease, Here are my answers:
|
Beta Was this translation helpful? Give feedback.
-
@dam-ease checks were done on the build machine, see screenshot I uploaded earlier: https://github.com/orgs/codemagic-ci-cd/discussions/2907#discussion-7791768 |
Beta Was this translation helpful? Give feedback.
-
Hello Flutter version is 3.29.0. Used with fvm integration. Project was created ~one month ago |
Beta Was this translation helpful? Give feedback.
-
Hello 👋 In our post-clone script, we addressed the SPM-related issue that occurred after integrating Swift Package Manager. The problem was caused by authentication failures when accessing our private repositories. By setting up Git credentials and a .netrc file, enabling interactive prompts, and adjusting Xcode’s Swift Package Manager settings, we resolved the error. Additionally, we perform environment cleaning, install Flutter packages and iOS pods, and verify that the "development" scheme is correctly shared. #!/bin/sh
set -e # Exit on first error
set -x # Print all executed commands to the log
# --------------------------------------------------------------------
# List files (for diagnostic purposes)
# --------------------------------------------------------------------
echo "Listing files..."
ls -lh
# --------------------------------------------------------------------
# Git and Swift Package Manager Credential Configuration
# --------------------------------------------------------------------
echo "Configuring Git credentials..."
# 1. Configure git credential helper
git config --global credential.helper store
# 2. Save credentials with URL encoding for the '@' symbol
USERNAME="user%40example.com" # Replace with your encoded username, e.g., "user%40example.com"
PASSWORD="SECRET_PASSWORD" # Replace with your password
cat > ~/.git-credentials <<EOL
http://${USERNAME}:${PASSWORD}@fake-git.example.com:3000
EOL
chmod 600 ~/.git-credentials
# 3. Create a .netrc file for Swift Package Manager usage
cat > ~/.netrc <<EOL
machine fake-git.example.com
login user@example.com # Replace with your actual login if needed
password SECRET_PASSWORD # Replace with your password
EOL
chmod 600 ~/.netrc
# 4. Enable interactive credential prompts for Git
git config --global --add --bool credential.interactive true
git config --global --add --bool core.askPass true
# 5. Swift Package Manager settings for Xcode
defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM NO
defaults write com.apple.dt.Xcode IDEPackageSupportCommandLineGitEnabled YES
# --------------------------------------------------------------------
# Clean Build Environment
# --------------------------------------------------------------------
echo "Cleaning project..."
flutter clean
rm -rf ios/Pods ios/Podfile.lock ios/Flutter/Flutter.xcframework ios/Flutter/Flutter.podspec
rm -rf ~/Library/Developer/Xcode/DerivedData
# --------------------------------------------------------------------
# Install Flutter Packages
# --------------------------------------------------------------------
echo "Installing Flutter packages..."
flutter pub get
# --------------------------------------------------------------------
# Install iOS Pods and Configure Xcode
# --------------------------------------------------------------------
echo "Installing iOS pods..."
cd ios
# Enable interactive credential prompts for Git (for SPM package fetching)
git config --global --add --bool credential.interactive true
# Install pods with repo update
pod install --repo-update
# --------------------------------------------------------------------
# List and Verify Xcode Schemes
# --------------------------------------------------------------------
echo "Listing Xcode schemes..."
xcodebuild -workspace Runner.xcworkspace -list
echo "Making 'development' scheme shareable..."
xcodebuild -workspace Runner.xcworkspace -scheme development -showBuildSettings || true
echo "Re-installing pods..."
pod install
echo "Verifying schemes..."
mkdir -p ~/Library/Developer/Xcode/DerivedData
find . -name "*.xcscheme" -type f -exec grep -l "development" {} \; |
Beta Was this translation helpful? Give feedback.
Thanks for your inputs, @sadespresso and @Maksimka101—they were really helpful here.
@verscph, I looked into this further, and it turns out the issue is related to the Flutter Swift Package Manager. I see that you have it enabled in your project as well. Initially, I couldn’t reproduce the issue because when I regenerated my iOS folder, the Swift Package Manager wasn’t enabled on my end.
The following error occurs: