Skip to content

SwiftPM could not resolve package dependencies #186785

Closed

Description

@alex-medinsh

Steps to reproduce

flutter run in a project that isn't yet migrated to SwiftPM

Actual results

The build errors with SwiftPM unable to resolve the firebase dependencies.

Logs

Logs
Adding Swift Package Manager integration...                        953ms
An error occurred when adding Swift Package Manager integration:
  Error: Unable to get Xcode project information:
 2026-05-20 09:52:21.532 xcodebuild[29595:2162262] Writing error result bundle to
 /var/folders/xm/f4b59z4d0dd575bxwfqg44wm0000gn/T/ResultBundle_2026-20-05_09-52-0021.xcresult
xcodebuild: error: Could not resolve package dependencies:
  Failed to resolve dependencies Dependencies could not be resolved because no versions of 'firebase-ios-sdk' match the requirement
  12.13.0..<13.0.0 and 'firebase_core-4.9.0' depends on 'firebase-ios-sdk' 12.13.0..<13.0.0.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.44.0, on macOS 26.4.1 25E253 darwin-arm64, locale en-GB) [721ms]
    • Flutter version 3.44.0 on channel stable at /Users/alex/workspace/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 559ffa3f75 (4 days ago), 2026-05-15 14:13:13 -0700
    • Engine revision 4c525dac5e
    • Dart version 3.12.0
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
      cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
      enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.5s]
    • Android SDK at /Users/alex/Library/Android/sdk
    • Emulator version 35.2.10.0 (build_id 12414864) (CL:N/A)
    • Platform android-36, build-tools 35.0.0
    • ANDROID_HOME = /Users/alex/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 26.5) [1,307ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17F42
    ! CocoaPods 1.13.0 out of date (1.16.2 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [6ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Connected device (2 available) [7.3s]
    • Alex’s iPhone (wireless) (mobile) • 00008130-001A310C0491401C • ios          • iOS 26.4.2 23E261
    • macOS (desktop)                   • macos                     • darwin-arm64 • macOS 26.4.1 25E253 darwin-arm64
    ! Error: Browsing on the local area network for Alex’s Apple Watch. Ensure the device is unlocked and discoverable via Bluetooth. (code
      -27)

[✓] Network resources [626ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

Activity

  1. alex-medinsh commented on May 20, 2026

    @alex-medinsh
    ContributorAuthor

    This might be a firebase_core issue, but the logs still asked to create an issue.

  2. puneetkukreja98 commented on May 21, 2026

    @puneetkukreja98
    Contributor

    @alex-medinsh Thanks for reporting this issue! Could you please share a sample GitHub repository that I can clone to reproduce the issue on my end?

    Similar issues:
    #186054
    #184021
    #185899

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    in triagePresently being triaged by the triage team
    on May 21, 2026
  4. alex-medinsh commented on May 21, 2026

    @alex-medinsh
    ContributorAuthor

    @puneetkukreja98 I am currently unable to reproduce this on a fresh project, but this issue happens on two separate projects which both use firebase_core, so my guess would be that this should be a project created with some previous version of Flutter for this issue to happen?
    Any ideas what I can try to pinpoint the problem?

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 21, 2026
  6. puneetkukreja98 commented on May 22, 2026

    @puneetkukreja98
    Contributor

    @alex-medinsh Go to the Pod-file and try changing the platform version to 15; firebase_core requires a minimum platform version of 15.

  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    in triagePresently being triaged by the triage team
    on May 22, 2026
  8. alex-medinsh commented on May 22, 2026

    @alex-medinsh
    ContributorAuthor

    It is already set to 15, since this is not a new project and already builds ok with Cocoapods. The issue happens when I enable SPM and the run command tries to migrate the project.

  9. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 22, 2026
  10. puneetkukreja98 commented on May 22, 2026

    @puneetkukreja98
    Contributor

    Routing this to team-ios for further investigation.

  11. added
    platform-iosiOS applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-macosBuilding on or for macOS specifically
    team-iosOwned by iOS platform team
    t: xcode"xcodebuild" on iOS and general Xcode project management
    on May 22, 2026
  12. alex-medinsh commented on May 22, 2026

    @alex-medinsh
    ContributorAuthor

    I was able to successfully build one of the projects. I killed all of the dart and flutter related processes, then ran flutter clean and then flutter build ios. The project was migrated to SwiftPM and then built.

    I ran flutter clean multiple times before that and it didn't help, but killing the processes resolved the issue. Can this be related to the way Flutter now fetches SwiftPM dependencies with a separate background process? Maybe the process got stuck or left some caches in a broken state.

    I still haven't ran flutter clean in the second project, so that we can use it to try to reproduce the issue.

  13. self-assigned this
    on May 28, 2026
  14. LouiseHsu commented on Jun 4, 2026

    @LouiseHsu
    Contributor

    @alex-medinsh Can you please provide your pubspec.lock? :)

  15. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Jun 4, 2026
  16. alex-medinsh commented on Jun 4, 2026

    @alex-medinsh
    ContributorAuthor

    Hi @LouiseHsu! I've attached the lockfile.

    pubspec.lock.txt

  17. vashworth commented on Jun 11, 2026

    @vashworth
    Contributor

    I was able to successfully build one of the projects. I killed all of the dart and flutter related processes, then ran flutter clean and then flutter build ios. The project was migrated to SwiftPM and then built.

    I ran flutter clean multiple times before that and it didn't help, but killing the processes resolved the issue. Can this be related to the way Flutter now fetches SwiftPM dependencies with a separate background process? Maybe the process got stuck or left some caches in a broken state.

    I still haven't ran flutter clean in the second project, so that we can use it to try to reproduce the issue.

    The separate background process was reverted, so hopefully this is fixed.

    I'm going to optimistically close this, but if you see this pop up again, please file another issue.

  18. github-actions commented on Jul 14, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  19. locked as resolved and limited conversation to collaborators on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions