Skip to content

fix(app): disable Swift Package Manager to unbreak iOS archives - #11677

Merged
mdmohsin7 merged 1 commit into
mainfrom
fix/disable-spm-firebase-conflict
Aug 16, 2026
Merged

mdmohsin7 merged 1 commit into
mainfrom
fix/disable-spm-firebase-conflict

Conversation

@mdmohsin7

@mdmohsin7 mdmohsin7 commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

What

Every iOS archive has failed since #11672 merged:

xcodebuild: error: Could not resolve package dependencies:
  Failed to resolve dependencies Dependencies could not be resolved because
  'firebase_crashlytics-4.3.2' depends on 'flutterfire' 3.11.0-firebase-core-swift and
  'firebase_messaging-15.2.5' depends on 'flutterfire' 3.13.0-firebase-core-swift.

Disables Swift Package Manager at the project level, restoring the CocoaPods plugin resolution that has been shipping all along. Four lines in app/pubspec.yaml.

Why it broke

#11672 moved Codemagic from Flutter 3.41.9 to 3.44.5 to fix pub get. That was the right fix for the Dart constraint, but 3.44 also flips a default I did not check. From flutter_tools/lib/src/features.dart:

// 3.41.9
const swiftPackageManager = Feature(
  stable: FeatureChannelSetting(available: true),                          // → off
);

// 3.44.5
const swiftPackageManager = Feature(
  stable: FeatureChannelSetting(available: true, enabledByDefault: true),  // → ON
);

3.41.9 resolved iOS plugins through CocoaPods. 3.44.5 resolves them as Swift packages, which exposes a version skew that was already in the repo and invisible under CocoaPods:

Pinned in app/pubspec.yaml Declares
firebase_core: 3.13.0 —
firebase_messaging: 15.2.5 firebase_core: ^3.13.0
firebase_crashlytics: 4.3.2 firebase_core: ^3.11.0

firebase_crashlytics is two minor versions behind the pinned core. CocoaPods tolerates that; SPM will not hold two versions of the same flutterfire package, so resolution fails outright.

Why this fix and not the version bump

The durable fix is aligning the Firebase plugins — tracked in #11676, with firebase_crashlytics 4.3.5 as the release built against firebase_core 3.13.0. That is a runtime dependency change to a shipping app whose only real acceptance test is an iOS archive, so it should land deliberately rather than as a hotfix.

This change instead restores the exact plugin resolution that was in production before #11672, which is the smallest thing that unblocks the release lanes.

Placed in pubspec.yaml rather than as a Codemagic env var or flutter config call: the project manifest is first in Flutter's resolution order (project → global config → environment), so it fixes local builds and every CI lane from one checked-in place, instead of leaving contributors on 3.44.x to rediscover this.

Flutter warns that disabling "will not be allowed in a future version", so #11676 is not optional — the comment in pubspec.yaml links it.

meta-wearables-dat-ios is unaffected: it is a direct XCRemoteSwiftPackageReference in Runner.xcodeproj, resolved by Xcode independently of Flutter's plugin SPM integration. The failing log shows it fetching successfully before Flutter's step failed.

Verification

I have no macOS, so I cannot run the archive that failed. What I could prove locally, I did:

  • The key is live and correctly spelled. Negative control: setting enable-swift-package-manager: "not-a-bool" in this pubspec makes flutter pub get exit with

    The "enable-swift-package-manager" property in "flutter: config:" in pubspec.yaml
    must be a boolean, but got not-a-bool (String)
    

    That message is emitted from _isEnabledAtProjectLevel reading flutterDescriptor['config']['enable-swift-package-manager'], so Flutter is demonstrably reading this key from this file. A typo would have silently no effect; this rules that out.

  • flutter pub get with the real value — Got dependencies!, lockfile unchanged.

  • app/test.sh on Flutter 3.44.5 with the flag set — 1338 passed, exit 0.

  • make preflight — 11/11.

Not verified: the iOS archive. .flutter-plugins-dependencies reports swift_package_manager_enabled: {ios: false, macos: false} on Linux whether or not the flag is set, because usesSwiftPackageManager is featureFlags.isSwiftPackageManagerEnabled && compatibleWithSwiftPackageManager and the second term needs Xcode. So that file is not evidence either way here, and I am not citing it as such. The first real proof is the next Codemagic iOS build.

Follow-up

Every iOS archive has failed since #11672:

  xcodebuild: error: Could not resolve package dependencies:
    'firebase_crashlytics-4.3.2' depends on 'flutterfire' 3.11.0-firebase-core-swift and
    'firebase_messaging-15.2.5' depends on 'flutterfire' 3.13.0-firebase-core-swift.

#11672 moved Codemagic to Flutter 3.44.5 to fix `pub get`. 3.44 also flips a
default I did not check: `swiftPackageManager` gained `enabledByDefault: true`
on stable, so iOS plugins resolve as Swift packages instead of through
CocoaPods. That exposes a skew already in the repo — firebase_crashlytics 4.3.2
declares firebase_core ^3.11.0 while firebase_messaging 15.2.5 declares
^3.13.0, against a pinned core of 3.13.0. CocoaPods tolerates it; SPM will not
hold two versions of the same flutterfire package.

Restores the plugin resolution that was in production before #11672. The
durable fix is aligning the Firebase plugins (#11676, crashlytics 4.3.5 is the
release built against core 3.13.0), which changes a shipping app's runtime
dependencies and wants an iOS archive as its acceptance test, not a hotfix.

Set in pubspec.yaml rather than a Codemagic env var or `flutter config`: the
project manifest is first in Flutter's resolution order, so one checked-in
place covers local builds and every CI lane. Flutter warns it will stop
honouring this, so #11676 is not optional; the comment links it.

meta-wearables-dat-ios is unaffected — a direct XCRemoteSwiftPackageReference
resolved by Xcode independently of Flutter's plugin SPM integration, and the
failing log shows it fetching fine before Flutter's step failed.

Verification (no macOS here, so the archive itself is unverified):
  Negative control proves the key is live and correctly spelled — setting
    `enable-swift-package-manager: "not-a-bool"` makes pub get exit with
    'The "enable-swift-package-manager" property in "flutter: config:" in
    pubspec.yaml must be a boolean', emitted from _isEnabledAtProjectLevel
    reading flutterDescriptor['config']. A typo would silently no-op; ruled out.
  flutter pub get with the real value — Got dependencies!, lockfile unchanged.
  make preflight — 11/11.
  .flutter-plugins-dependencies is NOT evidence here: it reports
    swift_package_manager_enabled false on Linux regardless, because
    usesSwiftPackageManager also requires Xcode.
First real proof is the next Codemagic iOS build.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@mdmohsin7
mdmohsin7 merged commit 14e7eed into main Aug 16, 2026
32 of 35 checks passed
@mdmohsin7
mdmohsin7 deleted the fix/disable-spm-firebase-conflict branch August 16, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant