Closed alephao closed 1 month ago
Hi @alephao, typically you can fix this using moduleAliases
in SPM. This allows you to disambiguate SwiftUINavigation that comes from swift-navigation version swiftui-navigation.
So, if you update one of your target's dependencies to do something like this:
.target(
name: "MyTarget",
dependencies: [
.product(
name: "SwiftUINavigation",
package: "swift-navigation",
moduleAliases: ["SwiftUINavigation", "SwiftUINavigation"]
)
]
)
…it should work.
However, it also turns out that Xcode's support for moduleAliases
is completely busted, even though it works in SPM just fine.
We have a PR that will merge soon (#3180) that integrates the new swift-navigation library into TCA, and so then at that point you will not need to depend on both libraries. And unfortunately I think until then you just can't use swift-navigation with TCA due to Xcode bugs.
Since this isn't any issue with the library I am going to convert it to a discussion. Feel free to continue the conversation over there.
Description
swift-navigation
2.0 was released a few days ago and will replaceswiftui-navigation
. I tried adding theswift-navigation
package to my project and got the following error message from spm:error: multiple targets named 'SwiftUINavigation' in: 'swift-navigation', 'swiftui-navigation'
Checklist
main
branch of this package.Expected behavior
No response
Actual behavior
No response
Steps to reproduce
swift package init
swift build
The Composable Architecture version information
No response
Destination operating system
No response
Xcode version information
No response
Swift Compiler version information