Is there an existing issue for this?
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:
|
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-manager
flutter create my_app && cd my_app
flutter pub add firebase_core:4.4.0
open ios/Runner.xcworkspace and update minimum version for iOS to 15.0
flutter build ios
flutter pub add firebase_core:4.5.0
flutter pub add firebase_analytics
flutter 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
Is there an existing issue for this?
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:
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
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 iosFirebase Core version
4.4.0/4.5.0
Flutter Version
3.43.0-1.0.pre-132
Relevant Log Output
Flutter dependencies
Expand
Flutter dependenciessnippetReplace this line with the contents of your `flutter pub deps -- --style=compact`.Additional context and comments
No response