-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.platform: macosIssues / PRs which are specifically for MacOS.Issues / PRs which are specifically for MacOS.plugin: coretype: 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?
Core
Which platforms are affected?
macOS
Description
macOS builds fail with SPM enabled due to incorrect path construction in Packages.swift
Reproducing the issue
- flutter config --enable-swift-package-manager
- flutter create foo
- cd foo
- flutter pub add firebase_core
- flutter build macos
Firebase Core version
3.8.1
Flutter Version
master (or any version with SPM support)
Relevant Log Output
An error occurred when adding Swift Package Manager integration:
Error: Unable to get Xcode project information:
2024-12-12 10:13:05.506 xcodebuild[46931:39639271] Writing error result bundle to
/var/folders/78/17y71k957t9g3wftxrwbd93h000x5_/T/ResultBundle_2024-12-12_10-13-0005.xcresult
xcodebuild: error: Could not resolve package dependencies:
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'main/Package.swift:76: Fatal
error: Failed to load configuration: fileNotFound("Error loading or parsing firebase_sdk_version.rb: Error Domain=NSCocoaErrorDomain
Code=260 \"The file “firebase_sdk_version.rb” couldn’t be opened because there is no such file.\"
UserInfo={NSFilePath=/Users/someuser/.pub-cache/hosted/pub.dev/firebase_core-3.8.1/macos/firebase_core/../../../firebase_core/ios/firebase_sdk_version.rb,
NSURL=file:///Users/someuser/.pub-cache/hosted/pub.dev/firebase_core-3.8.1/macos/firebase_core/../../../firebase_core/ios/firebase_sdk_version.rb, NSUnderlyingError=0x600003798000 {Error Domain=NSPOSIXErrorDomain Code=2 \"No such file or directory\"}}")
Flutter dependencies
No response
Additional context and comments
The path construction is clearly wrong, since firebase_core-3.8.1/macos/firebase_core/../../../
leaves the directory scope of the package and enters into the pub cache itself, so all bets are off as to what the relative paths are from there (perhaps this was written/tested only with overridden path dependencies?). It should be ../../ios/
rather than ../../../firebase_core/ios
.
The same issue appears to have been fixed for iOS in #13804, but macOS is still using the same incorrect path logic that iOS used to have.
Metadata
Metadata
Assignees
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.platform: macosIssues / PRs which are specifically for MacOS.Issues / PRs which are specifically for MacOS.plugin: coretype: bugSomething isn't workingSomething isn't working