-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.type: bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
No response
Which platforms are affected?
iOS, macOS
Description
When updating a Firebase plugin while using SwiftPM you may see an error like this:
Failed to resolve dependencies Dependencies could not be resolved because 'firebase_core' depends on 'flutterfire' 4.3.0-firebase-core-swift and 'firebase_analytics' depends on 'flutterfire' 4.4.0-firebase-core-swift.
This has been reported multiple times:
#17980
#17962
#18088
#18082
#18106
#18114
#17962
#16903
The cause is that the Firebase plugins use a variable to set the required version of it's remote SwiftPM dependencies:
flutterfire/packages/firebase_core/firebase_core/ios/firebase_core/Package.swift
Lines 98 to 101 in 0fa2818
| dependencies: [ | |
| .package(url: "https://github.com/firebase/firebase-ios-sdk", from: firebase_sdk_version), | |
| .package(url: "https://github.com/firebase/flutterfire", exact: shared_spm_version), | |
| ], |
SwiftPM calculates the version the first time it reads the manifest and then caches it. It does not re-run the swift code again unless the Package.swift changes.
The versions should be hard-coded rather than calculated.
Reproducing the issue
flutter config --enable-swift-package-managerflutter create my_app && cd my_appflutter pub add firebase_core:4.4.0open ios/Runner.xcworkspaceand update minimum version for iOS to 15.0flutter build iosflutter pub add firebase_core:4.5.0flutter pub add firebase_analyticsflutter build ios
Firebase Core version
4.4.0/4.5.0
Flutter Version
3.43.0-1.0.pre-132
Relevant Log Output
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.type: bugSomething isn't workingSomething isn't working