Flutter iOS builds fail with "Scheme Runner not found" after Swift Package Manager migration

Last updated: July 10, 2026

If your Flutter iOS builds are failing with the error "Build failed :| Scheme 'Runner' not found from repository!" after migrating to Swift Package Manager, this is likely due to missing ephemeral Swift packages that need to be generated before the build process begins.

The Problem

When Flutter projects are migrated to use Swift Package Manager (SPM), they rely on ephemeral packages located at Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage. These packages are generated at build time and are not stored in your git repository. If these packages don't exist when Codemagic tries to parse your project.pbxproj file during the "Installing dependencies" step, the build will fail to detect the Runner scheme.

The Solution

Add the following post-clone script to your workflow configuration to ensure the ephemeral Swift packages are generated before the dependency installation step:

#!/bin/sh
set -e
flutter config --enable-swift-package-manager
cd mobile
flutter pub get

Replace mobile with the actual path to your Flutter project if it's located in a different directory.

Why This Works

The flutter pub get command generates the necessary ephemeral Swift Package Manager packages that your iOS project references. By running this in the post-clone script, these packages are available when Codemagic parses your Xcode project file, allowing it to properly detect the Runner scheme.